-   Linux - Software (
-   -   make rsync output deleted files? (

hawarden 03-17-2005 05:14 PM

make rsync output deleted files?
I have been using rdist for several years to sync a couple computers' data areas. I recently switched to using rsync, but am running into a problem. With rdist, I get a list on stdout of which files were updated, installed, or removed. I can't figure out how to make rsync give me the same output. When I use the delete option, I have so far been unable to get any indication of what files were deleted. The only place I've found this information is in the log file on the rsync server, but that doesn't help me as the client computer does not have access to that file. The only files I every see on stdout are the files transferred, no matter how many v flags I put. Help!

homey 03-17-2005 05:57 PM

I just redirect the standard output to a file and the deletes are at the bottom of that file.

rsync -avz --delete-after -e ssh /mnt/tech/aclinux root@sony:/home/check > /home/list.txt

hawarden 03-17-2005 07:37 PM

No matter what I try, I never see the deleted files. Here is my code:


set src = "/aux3/backup"
set dst = "aux1"
set log = "/root/backup/rsync.aux3.`date +%y%m%d`"
# Do the backup
date |& tee /tmp/mailout3
/usr/local/bin/rsync -avH --delete --numeric-ids $src root@host::$dst |& tee -a /tmp/mailout3
date |& tee -a /tmp/mailout3

This is the output I get:

/root/backup 194# ./backup.nas3.csh
Thu Mar 17 15:32:14 HST 2005
building file list ... done

wrote 876 bytes read 40 bytes 203.56 bytes/sec
total size is 981447446 speedup is 1071449.18
Thu Mar 17 15:32:18 HST 2005

I've tried -e ssh, --delete-after, --stats, and nothing works. I even tried --log-format, but it doesn't seem to be making any difference. Maybe I'm doing something really stupid but for the life of me I can't see what it is. The script works as far as actually doing the work that it's intended to do, but I want the feedback, because when I was using rdist it was useful a few times to catch some problems before they became problems.

homey 03-17-2005 08:40 PM

Our systems are abit different, I'm using bash and the rsync is located in a different place. Other than that, your date statement looked like this...

`date +%y%m%d`"
and I use this..

`date '+%y%m%d'`"
I have tried this and it does make the output file and the deletes are on the bottom of that file.

log="/home/backlog`date '+%y%m%d'`.txt"
/usr/bin/rsync -avz --delete-after \
-e ssh $src root@sony:$dst > ${log}

hawarden 03-17-2005 10:52 PM

What version of rsync are you using? I don't think the extra bits (like the date) make any difference as it never seems to matter how I do the command, it never gives me that output, so maybe my version is old or something.

homey 03-17-2005 10:55 PM

On my FC3 system it's this...
rsync version 2.6.3 protocol version 28

hawarden 03-17-2005 11:11 PM

Hmm, mine is "rsync version 2.6.2 protocol version 28"

I have one computer that is running Solaris 2.8 and the other is redhat 7.3, but it's a vender-specific installation. I will try to play with a couple other distributions to make sure it's not an os issue.

hawarden 03-18-2005 12:12 PM

HA! I just installed the rsync 2.6.3 rpm and rsynced to/from that computer and there are the deleted files. But when I rsync from a 2.6.2 computer to the 2.6.3 computer I don't see the deleted files....and I can't go from 2.6.3 to 2.6.2 at all. So I guess my job for today is to upgrade rsync on all my computers :)

Thanks a lot for your help, this really helps!

homey 03-18-2005 12:24 PM

Glad you got it going! :)

All times are GMT -5. The time now is 12:52 PM.