SITUATION
=========
I am using a PC with windows Vista (home edition).
I recently bought a Toshiba 500GB external USB hard disk, which I connected to my Sitecom X6 N900 router. The router has 2 USB ports that can be configured to support samba devices.
So I assigned drive letter Z to the disk connected to the router, so it is now known as a network drive and can be seen by each PC on the network.
I want to use this network drive for automated backups, so I wrote a batch file (see below) to perform this backup. The batch file resides on the PC(s), so these PCs 'push' their data towards the samba drive. The alternative could be to place the batch file on the network drive and start it up from there ('pulling' the data in from the PCs to the network drive, but this would require me to identify in the batch file the PC from which the backup is to be taken, which I don't know how to do, nor do I want to do that as this requires me to know which PCs are all connected to the network, so the 'push' option seems to be the way to go).
THE BATCH FILE
==============
xcopy c:\users\Danny\DataD\*.* z:\data\backup\DataD /e/y/d/EXCLUDE:c:\users\Danny\excluderfile.txt > c:\users\Danny\bulog.txt
xcopy c:\users\Elien\DataE\*.* z:\data\backup\DataE /e/y/d/EXCLUDE:c:\users\Danny\excluderfile.txt >> c:\users\Danny\bulog.txt
xcopy c:\users\Wouter\DataW\*.* z:\data\backup\DataW /e/y/d/EXCLUDE:c:\users\Danny\excluderfile.txt >> c:\users\Danny\bulog.txt
xcopy c:\users\Lieve\DataL\*.* z:\data\backup\DataL /e/y/d/EXCLUDE:c:\users\Danny\excluderfile.txt >> c:\users\Danny\bulog.txt
copy c:\users\Danny\buz.bat z:\data\backup
copy c:\users\Danny\excluderfile.txt z:\data\backup
@echo off
echo %date% > c:\users\Danny\budate.txt
type c:\users\Danny\bulog.txt
set/p re="Please confirm exit ==> "
exit
PROBLEM
=======
When running the batch file, it fails because it seems not to be allowed to create the necessary (sub)folders for the backup. For example, the first subfolder under DataD is 'Afbeeldingen' and the system does not allow the batch file to create this folder.
TRIALS AND OBSERVATIONS
=======================
I'm running this batch file from the 'Danny' user, which is the administrator of this PC.
Copying files directly without creating (sub)folder (see the 2 copy commands in the batch file) does work, even through the batch file ! So I have the impression it's really about the batch file not having permissions to create subfolders (though as far as I can see, all permissions are granted to the batch file).
When connecting the drive directly to my PC, and changing the drive letter z in the batch file to whatever letter the USB disk is connected under, the batch file works!
Creating folders manually on the network drive (meaning USB drive connected to router) from within windows works, as well as creating folders through a DOS box (mkdir command)!
Running the batch file from a DOS box does not work (error = fault during creation of file, access to network denied, cannot create folder).
Running the batch file from a DOS box started as administrator does not work (results in same error as above)
Running the batch file from windows as administrator does not work (results in same error as above)
The folders on the hard disk show read-only selected when requesting the property of the folder (same whether disk is connected directly to PC or to router). Setting the registry StorageDevicePolicies WriteProtect to 0 (as suggested in forums when people complain their USB disk folders are write protected) does not help. Re-formatting the hard disk (as also suggested), did not help either.
When requesting the properties of the hard disk, while connected directly to PC, file system shows as NTFS, however, when requesting properties of disk connected as network drive to router, file system shows as FAT32. I wonder if the router is only capable of dealing with FAT/FAT32 formatted devices (mail sent to sitecom to ask, no reply yet), however given the fact that this is a recent router, that would be stupid.
Upgraded router firmware to version 2.9, which contained some improvement for samba server, but no change.
When disconnecting disk from router (after breaking connection via windows), router needs a reset when disk is reconnected, otherwise sambaport of router is not shown when trying to re-map the drive (which has me wondering about the quality of the sambaserver software on the router).
Another thing I tried is setting the EnableLinkedConnections to 1 in the HKEYLOCALMACHINE/SOFTWARE/Microsoft/Windows/CurrentVersion/Policies/System folder.
Formatting the USB disk in FAT32 is at this moment one step too far, which I'm not yet willing to take, as manual folder creation does work.
Any advice is appreciated.
Danny
=========
I am using a PC with windows Vista (home edition).
I recently bought a Toshiba 500GB external USB hard disk, which I connected to my Sitecom X6 N900 router. The router has 2 USB ports that can be configured to support samba devices.
So I assigned drive letter Z to the disk connected to the router, so it is now known as a network drive and can be seen by each PC on the network.
I want to use this network drive for automated backups, so I wrote a batch file (see below) to perform this backup. The batch file resides on the PC(s), so these PCs 'push' their data towards the samba drive. The alternative could be to place the batch file on the network drive and start it up from there ('pulling' the data in from the PCs to the network drive, but this would require me to identify in the batch file the PC from which the backup is to be taken, which I don't know how to do, nor do I want to do that as this requires me to know which PCs are all connected to the network, so the 'push' option seems to be the way to go).
THE BATCH FILE
==============
xcopy c:\users\Danny\DataD\*.* z:\data\backup\DataD /e/y/d/EXCLUDE:c:\users\Danny\excluderfile.txt > c:\users\Danny\bulog.txt
xcopy c:\users\Elien\DataE\*.* z:\data\backup\DataE /e/y/d/EXCLUDE:c:\users\Danny\excluderfile.txt >> c:\users\Danny\bulog.txt
xcopy c:\users\Wouter\DataW\*.* z:\data\backup\DataW /e/y/d/EXCLUDE:c:\users\Danny\excluderfile.txt >> c:\users\Danny\bulog.txt
xcopy c:\users\Lieve\DataL\*.* z:\data\backup\DataL /e/y/d/EXCLUDE:c:\users\Danny\excluderfile.txt >> c:\users\Danny\bulog.txt
copy c:\users\Danny\buz.bat z:\data\backup
copy c:\users\Danny\excluderfile.txt z:\data\backup
@echo off
echo %date% > c:\users\Danny\budate.txt
type c:\users\Danny\bulog.txt
set/p re="Please confirm exit ==> "
exit
PROBLEM
=======
When running the batch file, it fails because it seems not to be allowed to create the necessary (sub)folders for the backup. For example, the first subfolder under DataD is 'Afbeeldingen' and the system does not allow the batch file to create this folder.
TRIALS AND OBSERVATIONS
=======================
I'm running this batch file from the 'Danny' user, which is the administrator of this PC.
Copying files directly without creating (sub)folder (see the 2 copy commands in the batch file) does work, even through the batch file ! So I have the impression it's really about the batch file not having permissions to create subfolders (though as far as I can see, all permissions are granted to the batch file).
When connecting the drive directly to my PC, and changing the drive letter z in the batch file to whatever letter the USB disk is connected under, the batch file works!
Creating folders manually on the network drive (meaning USB drive connected to router) from within windows works, as well as creating folders through a DOS box (mkdir command)!
Running the batch file from a DOS box does not work (error = fault during creation of file, access to network denied, cannot create folder).
Running the batch file from a DOS box started as administrator does not work (results in same error as above)
Running the batch file from windows as administrator does not work (results in same error as above)
The folders on the hard disk show read-only selected when requesting the property of the folder (same whether disk is connected directly to PC or to router). Setting the registry StorageDevicePolicies WriteProtect to 0 (as suggested in forums when people complain their USB disk folders are write protected) does not help. Re-formatting the hard disk (as also suggested), did not help either.
When requesting the properties of the hard disk, while connected directly to PC, file system shows as NTFS, however, when requesting properties of disk connected as network drive to router, file system shows as FAT32. I wonder if the router is only capable of dealing with FAT/FAT32 formatted devices (mail sent to sitecom to ask, no reply yet), however given the fact that this is a recent router, that would be stupid.
Upgraded router firmware to version 2.9, which contained some improvement for samba server, but no change.
When disconnecting disk from router (after breaking connection via windows), router needs a reset when disk is reconnected, otherwise sambaport of router is not shown when trying to re-map the drive (which has me wondering about the quality of the sambaserver software on the router).
Another thing I tried is setting the EnableLinkedConnections to 1 in the HKEYLOCALMACHINE/SOFTWARE/Microsoft/Windows/CurrentVersion/Policies/System folder.
Formatting the USB disk in FAT32 is at this moment one step too far, which I'm not yet willing to take, as manual folder creation does work.
Any advice is appreciated.
Danny