When running the following cwrsync script on our SBS2003 server (backing up to a remote NAS), the results from the --stats flag tell me that no files or data were moved. But, the destination directory has been populated.
Also - where would I add a --delete flag into the options to ensure source = destination, but any deleted files are first copied to the BACKUPDIR.
<> - --stats reports results when I manually run the script. If I schedule it, no stats are reported.
SET SOURCE=/cygdrive/s/
SET DEST=%SPARENAS01%::HAVOFFSITE/shared
SET BACKUPDIR=xxx_backup_xxx/%date:~10,4%/%date:~7,2%/%date:~4,2%
SET OPTS=--force --update --backup-dir=%BACKUPDIR%/Shared --exclude=xxx_archive_xxx/ -- modify-window=5 --stats -brtz
rsync %OPTS% %SOURCE% %DEST% >> %date:~10,4%.log
You need to redirect stderr-output to your log file as well. Try this one:
rsync %OPTS% %SOURCE% %DEST% 1>>%date:~10,4%.log 2>>%date:~10,4%.log
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.