4

I created a batch script to back-up our server:

#!/bin/bash

user=$1

# create user dir
ssh root@local.backup.tst -p 5774  mkdir -p /var/backup/server.tst/incremental/$user

# backup mail dir
rsync -rvz --del --rsh='ssh -p5774' /home/$user/imap root@local.backup.tst:/var/backup/server.tst/incremental/$user 

cd /home/$user/domains
ls -1 | while read -r domain
do
        sh /etc/pxl/backup/domain.sh $user $domain
done

But when I'm running it sh script.sh username it hangs.

First I get sending incremental file list and after that is does not respond any more. When I press ctrl-C (abort script) the output changes:

sync error: unexplained error (code 130) at rsync.c(543) [sender=3.0.7]
sending incremental file list
public_html/gh.html
public_html/index.php
public_html/cgi-bin/.htaccess
public_html/... (and so on)

.. but hangs again. When I press ctrl-C again, I get:

rsync error: received SIGINT, SIGTERM, or SIGHUP (code 20) at rsync.c(543) [sender=3.0.7]

On both sides I have the same version installed (3.0.7, protocol 30). I already read this topic, but that does not resolve my issue.

Does anybody know what is going wrong here? How can I solve it? Thank you in advance!

  • Rsync has some kind of flag i guess to check over the files, and i am making assumption as i dont know what type of disk you are using, its taking time to update/check those changes. are you saying this never finishes or you being impatient. This could happen in various factor, e.g disk quality, number of changes, size of files. – tike Sep 3 '13 at 12:05
1

Try running the script with a -v (or 2). The verbose output will show you where/why it is stalling. Also, validate your escaped characters and absolute paths. They are fairly common reasons for rsync to stall.

0

The problem may be when rsync would have problems with deleting files on receiver. Try --ignore-errors to see if that's a case.

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.