My computer is setup as an FTP server so I can access files from campus. Right now I am working on a senior design project were we have a dedicated computer in a lab to do our work, but I want to syncronize the information on the two computers so the group members can access our files by logging onto my ftp server.
I have written this batch file to perform the synchronization every night. The transfer from the ftp server (mapped as drive Z:\) works great, but when I try to upload from the lab computer (C:\) to the ftp server (Z:\) I get the error that a directory cannot be created.
The "Backpack Alarm" Folder has a few files located in it, and several folders I also want to sync (hence the /s argument).
FTPSync.bat
------------------
REM Sets up the Z:\ drive to the FTP site and syncronizes
REM the 'C:\Backpack Alarm' folder on the computer in troxler
REM and the information on the FTP site.
REM - This code may only be ran on the computer in Troxler.
REM - The only files examined are the ones in which the ARCHIVE bit is set
REM - It uses the account 'XXXXXXX' to log into system.
REM - This Drive Mapping will be removed after logging out.
echo off
cls
echo Connecting drive
echo This may take several seconds....
net use z: \\FTPSERVERNAMEHERE\SeniorDesign /user:XXXXXXX ****** /Persistent:NO
echo Connection completed
echo ======================================
echo Transferring new files...
echo Troxler -to- FTP
echo ---------------------
xcopy ".\*.*" z:\ /a/d/s/y
REM The previous line does not work
REM TRANsFER NOT CURRENTLY WORKING,
echo PLEASE WAIT....
echo ---------------------
echo FTP updated with new files
echo Transferring new files...
echo FTP -to- Troxler
echo ---------------------
REM Switch to Z: directory
z:
xcopy .\*.* "C:\Backpack Alarm" /a/d/s/y
echo ---------------------
echo Troxler updated with new files
echo ==============================================
echo Transfer complete
echo The Files on the FTP and Troxler computer are now synchronized
echo on
---------------
Everything works correctly except the "xcopy ".\*.*" z:\ /a/d/s/y" command; it returns an error that the director cannot be created. (The account does have Read/Write permission and the command does copy the files located directly in C:\Backpack Alarm. It just freaks out when it starts to go into the subdirectories.
Does anybody have any suggestions on what I can do. or what may be causing the error? Some of the subfolders go pretty deep and I don't want to have to go through them recursively and copy all the files from each folder individually.
Any help would be much appreciated.
I have written this batch file to perform the synchronization every night. The transfer from the ftp server (mapped as drive Z:\) works great, but when I try to upload from the lab computer (C:\) to the ftp server (Z:\) I get the error that a directory cannot be created.
The "Backpack Alarm" Folder has a few files located in it, and several folders I also want to sync (hence the /s argument).
FTPSync.bat
------------------
REM Sets up the Z:\ drive to the FTP site and syncronizes
REM the 'C:\Backpack Alarm' folder on the computer in troxler
REM and the information on the FTP site.
REM - This code may only be ran on the computer in Troxler.
REM - The only files examined are the ones in which the ARCHIVE bit is set
REM - It uses the account 'XXXXXXX' to log into system.
REM - This Drive Mapping will be removed after logging out.
echo off
cls
echo Connecting drive
echo This may take several seconds....
net use z: \\FTPSERVERNAMEHERE\SeniorDesign /user:XXXXXXX ****** /Persistent:NO
echo Connection completed
echo ======================================
echo Transferring new files...
echo Troxler -to- FTP
echo ---------------------
xcopy ".\*.*" z:\ /a/d/s/y
REM The previous line does not work
REM TRANsFER NOT CURRENTLY WORKING,
echo PLEASE WAIT....
echo ---------------------
echo FTP updated with new files
echo Transferring new files...
echo FTP -to- Troxler
echo ---------------------
REM Switch to Z: directory
z:
xcopy .\*.* "C:\Backpack Alarm" /a/d/s/y
echo ---------------------
echo Troxler updated with new files
echo ==============================================
echo Transfer complete
echo The Files on the FTP and Troxler computer are now synchronized
echo on
---------------
Everything works correctly except the "xcopy ".\*.*" z:\ /a/d/s/y" command; it returns an error that the director cannot be created. (The account does have Read/Write permission and the command does copy the files located directly in C:\Backpack Alarm. It just freaks out when it starts to go into the subdirectories.
Does anybody have any suggestions on what I can do. or what may be causing the error? Some of the subfolders go pretty deep and I don't want to have to go through them recursively and copy all the files from each folder individually.
Any help would be much appreciated.