rsync script error
Stephen Goldman
sgoldman-DPNOqEs/LNQ at public.gmane.org
Sat Dec 12 13:20:37 EST 2009
Good afternoon Blu,
I 've been doing a hit and miss with a rsync script I wrote that is not working.
Appreciate a review from more experience eyes and suggested reference -
RHEL system-Red Hat Enterprise Linux Server release 5.4 (Tikanga)
I have an NFS mount from a NET APP filer that is running ".snapshots" of the directory mounted on
/mnt/external -- wish to sync to /data/biomicro/external AND skip .snapshots - on mnt/external-
send email message - script to be run from cron.daily
Combining the --delete and exclude statements is confusing.
#!/bin/bash
/usr/bin/rsync -avz --delete / --exclude ".snapshot" /mnt/external/. /data/biomicro/external >> /var/log/rsync/backup.log mail -s "back cron job external ran" sgoldman-3s7WtUTddSA at public.gmane.org
~
When I test from /root - I error out.
]
rsync: -s: unknown option
rsync error: syntax or usage error (code 1) at main.c(1231) [client=2.6.8]
[root@ ~]#
Thanks for your input,
Stephen
everyday is a learning experience
http://everythinglinux.org/rsync/
Using Rsync Itself
Now on to actually using, or initiating an rsync transfer with rsync itself. It's the same binary as the daemon, just without the "--daemon" flag. It's simplicity is a virtue. I'll start with a commandline that I use in a script to synchronize a Web tree below.
rsync --verbose --progress --stats --compress --rsh=/usr/local/bin/ssh \
--recursive --times --perms --links --delete \
--exclude "*bak" --exclude "*~" \
/www/* webserver:simple_path_name
Stephen Goldman
Systems Administrator
Department of Biology
Massachusetts Institute of Technology
31 Ames Street, Cambridge, MA 02139
sgoldman-3s7WtUTddSA at public.gmane.org, (617) 452-2595
More information about the Discuss
mailing list