LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 03-17-2005, 05:14 PM   #1
hawarden
Newbie
 
Registered: Feb 2005
Location: Hawaii
Distribution: centos/fedora/redhat/solaris
Posts: 28

Rep: Reputation: 15
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!
 
Old 03-17-2005, 05:57 PM   #2
homey
Senior Member
 
Registered: Oct 2003
Posts: 3,057

Rep: Reputation: 61
I just redirect the standard output to a file and the deletes are at the bottom of that file.
Code:
rsync -avz --delete-after -e ssh /mnt/tech/aclinux root@sony:/home/check > /home/list.txt
 
Old 03-17-2005, 07:37 PM   #3
hawarden
Newbie
 
Registered: Feb 2005
Location: Hawaii
Distribution: centos/fedora/redhat/solaris
Posts: 28

Original Poster
Rep: Reputation: 15
No matter what I try, I never see the deleted files. Here is my code:

Code:
#!/bin/csh
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.
 
Old 03-17-2005, 08:40 PM   #4
homey
Senior Member
 
Registered: Oct 2003
Posts: 3,057

Rep: Reputation: 61
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...
Code:
`date +%y%m%d`"
and I use this..
Code:
`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.
Code:
#!/bin/bash
src="/mnt/tech/aclinux"
dst="/home/check"
log="/home/backlog`date '+%y%m%d'`.txt"
/usr/bin/rsync -avz --delete-after \
-e ssh $src root@sony:$dst > ${log}

Last edited by homey; 03-17-2005 at 08:54 PM.
 
Old 03-17-2005, 10:52 PM   #5
hawarden
Newbie
 
Registered: Feb 2005
Location: Hawaii
Distribution: centos/fedora/redhat/solaris
Posts: 28

Original Poster
Rep: Reputation: 15
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.
 
Old 03-17-2005, 10:55 PM   #6
homey
Senior Member
 
Registered: Oct 2003
Posts: 3,057

Rep: Reputation: 61
On my FC3 system it's this...
rsync version 2.6.3 protocol version 28
 
Old 03-17-2005, 11:11 PM   #7
hawarden
Newbie
 
Registered: Feb 2005
Location: Hawaii
Distribution: centos/fedora/redhat/solaris
Posts: 28

Original Poster
Rep: Reputation: 15
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.

Last edited by hawarden; 03-17-2005 at 11:13 PM.
 
Old 03-18-2005, 12:12 PM   #8
hawarden
Newbie
 
Registered: Feb 2005
Location: Hawaii
Distribution: centos/fedora/redhat/solaris
Posts: 28

Original Poster
Rep: Reputation: 15
Cool

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!
 
Old 03-18-2005, 12:24 PM   #9
homey
Senior Member
 
Registered: Oct 2003
Posts: 3,057

Rep: Reputation: 61
Thumbs up

Glad you got it going!
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
RSYNC and dot files Buto Linux - General 1 09-22-2005 02:39 PM
I accidentally deleted make file in /usr/local/bin, now cannot use make command.... Niceman2005 Linux - Software 2 11-17-2004 07:55 PM
How to make deleted files auto go to trash bin? subaruwrx Slackware 1 07-24-2004 10:10 AM
How to delete the destination files while the source files deleted in cp -u ? myunicom Linux - General 4 09-26-2003 01:13 PM
How to make sure deleted files are put into trash can so that I can undelete them. futurist Linux - General 4 03-20-2003 02:30 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 04:41 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration