Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers rsync
# 1  
Old 09-01-2001
Question rsync

I want to do rsync only for the difference in the last 30 days. How do I specify the "30 days" on the command line below?

>rsync -avz prj# /rsource /destination

Thanks for help
# 2  
Old 09-01-2001
from what I understand,
"rsync -avz prj# /rsource /destination" performs
the update of the differences. If this is so,
why not just run this from cron every 30 days?
# 3  
Old 09-02-2001
Thanks for your cron job suggestion, rwb1959. I just wonder if this is just a one time job, what I should do? How do I specify the number of days, weeks, or months?Smilie
# 4  
Old 09-02-2001

First thing you want to do is check out the
man page for the command crontab(1) and the
file format for crontab(5).
You need to edit the user's (say Joe) crontab by:
crontab -u joe -e

...the make your entry. By the way, the editor
will be either "vi" or whatever you EDITOR
env. variable is set to. The man page for the
file format should show you exactly how to make
an entry to get what you want (I don't want to
give it away Smilie ) and you save it.

just an example:

# run at 10 pm on weekdays, annoy Joe
0 22 * * 1-5 mail -s "It's 10pm" joe%Joe,%%HI JOE!!!%

Last edited by Yogesh Sawant; 12-10-2010 at 05:10 AM.. Reason: added code tags
# 5  
Old 09-04-2001
Hammer & Screwdriver

Thanks for your great help Smilie ! Besides cronjob can you do a script and put the time range somewhere on the command line? Smilie
# 6  
Old 09-04-2001
Well, I'm not an rsync guru, and I don't see
(from the man page) any way to specify
a time range to rsync. If you wanted, you could
generate a specific list of files to sync to
the remote. You could create a script that uses
the "find" command using the -mtime option to
determine what files have been modified within
a given number of days and output this to a file
then use this file as a list of files to "sync".
As far as scheduling jobs however, cron is
"THE" scheduling program for UNIX. For instance,
you could execute the shell script that "looks"
for files modified in the last 30 days then have
the script run rsync.
# 7  
Old 09-04-2001

Many thanks, rwb1959. Smilie

I set a simple script for one time rsync:
/usr/local/bin/rsync -avz /rsource /destination
# --end of script--

I also setup a cron schedule for byweekly rsync jobs:
0 22 1,16 * * /usr/local/bin/rsync -avz /rsource /destination

I did some tests. Both worked very well. Thanks again! Smilie


Last edited by Yogesh Sawant; 12-10-2010 at 05:11 AM.. Reason: added code tags
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Rsync Error: rsync: link_stat failed: No such file or directory (2)

I wish to copy all the files & folder under /web/Transfer_Files/data/ on mymac1 (Linux) to remote server (Solaris 10) /tmp/ location I am using Ansible tool synchronize module which triggers the unix rsync command as below:rsync --delay-updates -F --compress --archive --rsh=ssh... (2 Replies)
Discussion started by: mohtashims
2 Replies

2. UNIX for Dummies Questions & Answers


Hi all, I'm new to the rsync world in hpux. Currently I have rsync going through the main public lan, but dude to traffic loads, I have been told that i need to use a dedicated rsync lan. I currently have 4 spare nics and the plan was to use one of these for the rsync, but I can't figure out... (2 Replies)
Discussion started by: linuxwanabe
2 Replies

3. SuSE


I'm trying to use rsync to sync some data from my windows laptop to my linux openSUSE home sytem using cwRsync. The process has always worked until I got a new laptop and more or less at the same time decided to rebuild my linux box. on linux rsync --version rsync version 3.0.7 protocol... (2 Replies)
Discussion started by: giessenw
2 Replies

4. Shell Programming and Scripting


Am I correct in assuming that the following command: rsync -a /a /b does not make any changes on /a if there are files on /b that are newer (2 Replies)
Discussion started by: jgt
2 Replies

5. Shell Programming and Scripting


hi there I wonder if some-one can help. I am trying to use rsync on my mac to transfer a folder to a remote machine. I have logged into rysnc on my mac no problem and I'm trying to execute this command: rsync -a -e ssh /Users/myname/myfolder/sourcefolder/... (3 Replies)
Discussion started by: volterony
3 Replies

6. UNIX for Dummies Questions & Answers


i last night i copied a 400GB folder using rsync and ssh i did: rsync -r /mnt/500_GB ssh miguel@ and it copied the folder fine all 400GB. The question is: If i put more files to that initial 400GB folder, which command can i run on my server for it to update the... (4 Replies)
Discussion started by: supermiguel
4 Replies

7. Solaris

please help in rsync

Dear all, I m trying to rsync a file remotely but it is throwing following error. #/opt/sfw/bin/rsync -v -a -e ssh user@xx.xx.xx.xx:/export/home/naresh/ bash: rsync: command not found rsync: connection unexpectedly closed (0 bytes read so far) rsync error: error in... (10 Replies)
Discussion started by: naree
10 Replies

8. UNIX for Dummies Questions & Answers

rsync vs cp

Hi guys, I will be copying data from one FS to another. (only once) These are local Filesystems... Which tool would be more efficient to use in this case? There is a huge amount of data that needs to be copied... (1.5TB) John (1 Reply)
Discussion started by: jsy
1 Replies

9. UNIX for Advanced & Expert Users


I have to update my files to 2-4 servers and I tar all the files and ftp to every server. I have heard about Rsync, but are there any other ways that are the same as Rsync?> (1 Reply)
Discussion started by: darknite87
1 Replies
Login or Register to Ask a Question