cron, rsync and permissions
GianLuca Sarto
glsarto at tiscali.it
Thu Apr 17 07:57:35 GMT 2008
Hello,
I am at my first attempts with scripting, cron, and rsync, so please
bear with me...
The scope is to backup two servers from a dedicated backup pc, with the
following script:
mv *.log archive
rsync --log-file=oracle.log -av -e "ssh -i .ssh/rsync-key"
gian at oracle:/home/gian/exp* oracle/
rsync --log-file=vib_home.log -av --delete --exclude=".*/" -e "ssh -i
.ssh/rsync-key" gian at vib:/home/ vib_home/
rsync --log-file=vib_office.log -av --delete -e "ssh -i .ssh/rsync-key"
gian at vib:/office/ vib_office/
This script works fine from the command line, but the last two lines
hang with permissions errors when executed as cron job.
The cron job is in my user table.
First backup from server oracle works fine, because the two files copied
are in my home directory, so no permission issues.
The second backup hangs with this error:
2008/04/17 02:00:28 [6161] receiving file list
2008/04/17 02:00:28 [6161] rsync: opendir "/home/gabri/Maildir" failed:
Permission denied (13)
2008/04/17 02:00:28 [6161] rsync: opendir "/home/enzo/Maildir" failed:
Permission denied (13)
2008/04/17 02:00:28 [6161] rsync: opendir "/home/enzo/Mail" failed:
Permission denied (13)
2008/04/17 02:00:28 [6161] rsync: opendir "/home/francesco/Maildir"
failed: Permission denied (13)
2008/04/17 02:00:28 [6161] rsync: opendir "/home/deborah/Maildir"
failed: Permission denied (13)
2008/04/17 02:00:28 [6161] rsync: opendir "/home/deborah/mail" failed:
Permission denied (13)
2008/04/17 02:00:28 [6161] rsync: opendir "/home/lost+found" failed:
Permission denied (13)
2008/04/17 02:00:28 [6161] rsync: opendir "/home/william/Maildir"
failed: Permission denied (13)
2008/04/17 02:00:28 [6161] rsync: opendir "/home/faxmaster/Maildir"
failed: Permission denied (13)
2008/04/17 02:00:28 [6161] rsync error: errors with program diagnostics
(code 13) at log.c(230) [receiver=2.6.9]
I do not have read permissions for the folders above, but I can read all
the rest.
Why rsync aborts?
The third backup reports this:
2008/04/17 02:00:33 [6163] receiving file list
2008/04/17 02:00:33 [6163] rsync: opendir "/office/lost+found" failed:
Permission denied (13)
2008/04/17 02:00:33 [6163] rsync error: errors with program diagnostics
(code 13) at log.c(230) [receiver=2.6.9]
The same here.
I have read permissions for all folders excepting for lost+found.
Why rsync gives up on the first error?
As I said, launching ./backup.sh from command line the script warns
about permission errors, but goes on.
Thanks for your time,
cheers,
-Gian
More information about the rsync
mailing list