The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
.
google unix.com



UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
please help in rsync naree SUN Solaris 10 10-01-2008 07:34 AM
rsync vs cp jsy UNIX for Dummies Questions & Answers 1 03-24-2008 04:51 PM
rsync over ftp Hitori UNIX for Advanced & Expert Users 2 03-14-2008 01:42 PM
rsync in ftp Euler04 Shell Programming and Scripting 5 10-24-2005 07:17 AM
Rsync darknite87 UNIX for Advanced & Expert Users 1 06-06-2002 03:37 PM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 09-01-2001
wz253 wz253 is offline
Registered User
  
 

Join Date: Aug 2001
Posts: 4
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 (permalink)  
Old 09-01-2001
rwb1959's Avatar
rwb1959 rwb1959 is offline
Registered User
  
 

Join Date: Aug 2001
Location: Virginia, USA
Posts: 438
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 (permalink)  
Old 09-02-2001
wz253 wz253 is offline
Registered User
  
 

Join Date: Aug 2001
Posts: 4
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?
  #4 (permalink)  
Old 09-02-2001
rwb1959's Avatar
rwb1959 rwb1959 is offline
Registered User
  
 

Join Date: Aug 2001
Location: Virginia, USA
Posts: 438
crontab

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 ) 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!!!%
  #5 (permalink)  
Old 09-04-2001
wz253 wz253 is offline
Registered User
  
 

Join Date: Aug 2001
Posts: 4
Wink

Thanks for your great help ! Besides cronjob can you do a script and put the time range somewhere on the command line?
  #6 (permalink)  
Old 09-04-2001
rwb1959's Avatar
rwb1959 rwb1959 is offline
Registered User
  
 

Join Date: Aug 2001
Location: Virginia, USA
Posts: 438
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 (permalink)  
Old 09-04-2001
wz253 wz253 is offline
Registered User
  
 

Join Date: Aug 2001
Posts: 4
Smile

Many thanks, rwb1959.

I set a simple script for one time rsync:

#!/bin/sh
date
/usr/local/bin/rsync -avz /rsource /destination
date
# --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!

wz253
Closed Thread

Bookmarks

Tags
mtime

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 10:14 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0