You are not logged in.

#1 2011-10-31 15:26:43

lost eden
Member
Registered: 2008-01-01
Posts: 62

discrepancy in rsync between 2 hosts

I have a simple backup script that runs as a cron job every day at 4am, which essentially just does a git add & git commit of the git repo I use for my university work & then rsync's the entire repo to 2x servers, the first owned by the university & the other a VPS that I rent. Here is the script itself;

#!/bin/bash
 
echo '/home/cj/.gitbackup.sh running...'
 
/usr/bin/keychain $HOME/.ssh/id_rsa
source $HOME/.keychain/$HOSTNAME-sh
 
cd ~/array_flatline/PhD
git add .
git commit -m "gitbackup commit"
 
echo -e '\nrsync to cjd44.host.cs.st-andrews.ac.uk...'
rsync -av -e ssh ~/array_flatline/PhD cjd44@cjd44.host.cs.st-andrews.ac.uk:~/
 
echo -e '\nrsync to min (213.152.172.24)...'
rsync -av -e ssh ~/array_flatline/PhD 213.152.172.24:~/
 
echo -e '\n/home/cj/.gitbackup.sh completed'

It seems to work fine to my VPS, but not to the university's server, as the disk usage on the university's server is ~600M too low. When I do 'du -ah' on the folder on all 3 machines after the script has run, these are the results I get;

Original machine;

[cj@flatline ~]$ du -ah ~/array_flatline/PhD/
1.5G    /home/cj/array_flatline/PhD/

University's server;

-bash-4.1$ du -ah ~/PhD/
992M    /cs/home/cjd44/PhD/

My VPS;

[cj@min ~]$ du -ah ~/PhD/
1.5G    /home/cj/PhD/

Can anybody provide any insight as to why this might be happening? I have already tried doing 'rm -rf' on the PhD folders on both the university's server & my VPS so that they are copying the entire folder anew, but it made no difference. I don't think it is just a difference between different versions of utilities reporting disk usage in different ways, because the discrepancy is too large.

Offline

Board footer

Powered by FluxBB