Problem with backup script

Hi,

Following is the script I made for backing up Cpanel server.

================================================

#! /bin/bash


rsync -raopguzl  --delete --exclude "*.tar.gz" --progress --delete-excluded root@$hostname:/$otherdir/$i/ /mnt/iscsi/$hostname/home/$i


done

================================================

Script is fine but the Rsync stucks at

md5sum is: cc613b32c467ec0cc7ee0cbd49b8bb2f
cpmove-a2801cen.tar.gz 100% 456KB 456.3KB/s 00:00
receiving file list ...
3350 files to consider

sent 16 bytes received 87767 bytes 58522.00 bytes/sec
total size is 34898318 speedup is 397.55

Rsync is not exiting and going to next user.

Please let me know that where I am wrong.

Thanks in advance

Rsync is not exiting, you're sure? Did you just try and put an echo behind the rsync statement? Maybe an echo $? to check what exit code it has. Also maybe add a -v to rsync to see more of it.

Also please use [ code ] tags when posting scripts, data, logs etc. ty.

Hi,

Ok I added one echo statment after rsync

 echo "rsync complete for user $i" 

And got the result

rsync complete for user a2801cen

BUt it hangs after this. One strange thing. As soon as I press ctrl+C it start with another user. For termination of script I have to press ctrl+C thrice

So may be it is not existing properly and going to next user automatically.

Hi,

Problem was with the firewall. It was stopping repeated connections to the server. My bad :frowning:

Hi all

I have a backup script which will tar some of folders and scp to the tape drive. Now is i run the script manually it creates a bakup of 2.8 Gb if i crontab the same script every day its creating a back up of just 38 Mb.. most of the dirs are not there at all..
Please help.....

Regards
RG

First, you've hijacked a thread rather than starting your own. Second, you haven't provided enough information for anyone to help.

It's possible that it's related to environment. The cron environment is not the same as a user profile when you are logged in. However, that's just a shot in the dark. Tell us what your script is, what you are trying to back up, what your system is and the remote system (presuming from scp) and tape drive. Provide enough detail and explanation and someone should be able to help. Or you might answer it yourself. :wink:

Iam sorry I shall do that . i shall start new thread adn will explain the issue in detail..
Thanks