Hi, I have a fairly simply batch file to backup a Directory on Server 2008 using cwrsync to a Linux server, and to restore.
Backup script:
@ECHO OFF
SETLOCAL
SET CWRSYNCHOME=C:\Program Files (x86)\cwRsync
SET CYGWIN=nontsec
SET HOME=%HOMEDRIVE%%HOMEPATH%
SET CWOLDPATH=%PATH%
SET PATH=%CWRSYNCHOME%\BIN;%PATH%
rsync -e "ssh -i new.key" -r --verbose -tz --stats --progress --delete '/cygdrive/c/users/test/documents/' user@host:"/test/documents"
Restore script
@ECHO OFF
SETLOCAL
SET CWRSYNCHOME=C:\Program Files (x86)\cwRsync
SET CYGWIN=nontsec
SET HOME=%HOMEDRIVE%%HOMEPATH%
SET CWOLDPATH=%PATH%
SET PATH=%CWRSYNCHOME%\BIN;%PATH%
rsync -e "ssh -i new.key" -r -tz --stats --progress [email protected]:"/test/documents/" '/cygdrive/c/users/test/documents'
This has been working fine to restore the differences in files, but recently I deleted everything to test the restore functionality, and had a host of problems.
Specifically, none of the filetimes were preserved, and the creation and moficiation date of them all was the time they were downloaded as new.
Then, there were a host of problems with the NTFS permissions. Specifically, when the files were restored many now had a deny permission, which did not stop me from accessing the files, but stopped my backup script from being able to backup.
Is there a way I can preserve NTFS permissions and filetimes?