PDA

View Full Version : problems with rsync


unsichtbare
24th November 2008, 23:55
When I run rsync I get:

rsync: opendir "/var/www/web5/user/web5_rsts/Maildir" failed: Permission denied (13)
rsync: opendir "/var/www/web5/user/web5_rsts/.spamassassin" failed: Permission denied (13)
rsync: opendir "/var/www/web5/user/web5_test/Maildir" failed: Permission denied (13)
rsync: opendir "/var/www/web5/user/web5_test/.spamassassin" failed: Permission denied (13)

Although it does successfully copy some files.

Also, when I try to automate the rsync process following the tutorial, it still asks for a password, then fails.

root@mirrior1:~# rsync -avz --delete --exclude=**/stats --exclude=**/error --exclude=**/files/pictures -e "ssh -i /root/rsync/mirror-rsync-key" someuser@clients1.myserver.com:/var/www/ /var/www/
someuser@clients1.myserver.com's password:
bash: /home/someuser/rsync/checkrsync: /bin/shcase: bad interpreter: No such file or directory
rsync: connection unexpectedly closed (0 bytes received so far) [receiver]
rsync error: remote command could not be run (code 126) at io.c(454) [receiver=2.6.9]

Yes I actually created a user account "someuser", following the tutorial.

Any suggestions?

One other thing, when I ran:

ssh-keygen -t dsa -b 2048 -f /root/rsync/mirror-rsync-key

as root, it told me that the key needed to be 1024 bits so I changed 2048 to 1024 and re-ran it.

-J

till
25th November 2008, 12:20
Please run the rsync command as root user, otherwise the process does not has the permissions to copy the files.

unsichtbare
25th November 2008, 20:22
login as: root
root@XX.YY.ZZ.103's password:
Last login: Mon Nov 24 08:13:47 2008 from
Linux mirrior1.myserver.com 2.6.20-15-server #2 SMP Sun Apr 15 07:41:34 UTC 2007 i686

The programs included with the Ubuntu system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Ubuntu comes with ABSOLUTELY NO WARRANTY, to the extent permitted by
applicable law.
root@mirrior1:~# rsync -avz --delete --exclude=**/stats --exclude=**/error --exclude=**/files/pictures -e "ssh -i /root/rsync/mirror-rsync-key" someuser@clients1.myserver.com:/var/www/ /var/www/
someuser@clients1.myserver.com's password:
bash: /home/someuser/rsync/checkrsync: /bin/shcase: bad interpreter: No such file or directory
rsync: connection unexpectedly closed (0 bytes received so far) [receiver]
rsync error: remote command could not be run (code 126) at io.c(454) [receiver=2.6.9]
root@mirrior1:~#


I was careful to run commands either as "someuser" or root as specified in the tutorial.

-J

till
26th November 2008, 13:24
Yes, but if someuser has not the permissions to read files, it can not be synced :)

falko
26th November 2008, 17:08
What's in /home/someuser/rsync/checkrsync?

unsichtbare
12th December 2008, 18:13
/home/someuser/rsync/checkrsync
#!/bin/shcase "$SSH_ORIGINAL_COMMAND" in *\&*) echo "Rejected" ;; *\(*) echo "Rejected" ;; *\{*) echo "Rejected" ;; *\;*) echo "Rejected" ;; *\<*) echo "Rejected" ;; *\`*) echo "Rejected" ;; rsync\ --server*) $SSH_ORIGINAL_COMMAND ;; *) echo "Rejected" ;;esac
~



-J

falko
13th December 2008, 19:04
The problem is that you have everything in one line. It must look like this instead:

#!/bin/sh

case "$SSH_ORIGINAL_COMMAND" in
*\&*)
echo "Rejected"
;;
*\(*)
echo "Rejected"
;;
*\{*)
echo "Rejected"
;;
*\;*)
echo "Rejected"
;;
*\<*)
echo "Rejected"
;;
*\`*)
echo "Rejected"
;;
rsync\ --server*)
$SSH_ORIGINAL_COMMAND
;;
*)
echo "Rejected"
;;
esac