Register
It is currently Mon Oct 20, 2014 11:56 am

Sync Modified Times


All times are UTC - 6 hours


Post new topic Reply to topic  [ 7 posts ] 
Author Message
 PostPosted: Mon Aug 21, 2006 12:44 pm   

Joined: Mon Aug 21, 2006 12:37 pm
Posts: 10
I need to sync my modified file times from my machine to my webserver. For some reason they are not the same, so when I run rsync it wants to copy everything over. I am very new to bash scripting, is there a way to do this in bash?


Top
 Profile  
 PostPosted: Mon Aug 21, 2006 1:06 pm   
User avatar

Joined: Tue May 17, 2005 12:55 am
Posts: 86
Location: Big Easy, Louisiana
jgallen23 wrote:
I need to sync my modified file times from my machine to my webserver. For some reason they are not the same, so when I run rsync it wants to copy everything over. I am very new to bash scripting, is there a way to do this in bash?


Welcome to BashScripts. Is this for a native Linux, or are you trying to do this between different OSes? As to can this be done with bash, yes. If there is a command for it then bash will handle it nicely, provided some variables. What filesystem is this for, reiserfs, ext2, ext.3. You should provide some more details. Are you using ntp?

Hope you like it here :D


Top
 Profile YIM  
 PostPosted: Mon Aug 21, 2006 1:08 pm   

Joined: Mon Aug 21, 2006 12:37 pm
Posts: 10
I'm actually using cygwin. Both boxes are Windows boxes with ntfs filesystem. I've always interested in Linux and I figured using cygwin would be the first step and if I liked it, I'd feel more comfortable moving over.


Top
 Profile  
 PostPosted: Mon Aug 21, 2006 1:16 pm   

Joined: Mon May 16, 2005 6:29 pm
Posts: 94
Location: Upstate NY
since you are using m$ filesystems which don't respect modified times rsync will not work for you the way you want it too you will need to look at a application called unison to be able to sync between the boxes. it has a cli version that you should be able to script into a normal bat file. i'm not sure if you will be able to use cygwin with bash create the script you want


Top
 Profile WWW  
 PostPosted: Mon Aug 21, 2006 3:25 pm   

Joined: Mon Aug 21, 2006 12:37 pm
Posts: 10
I am using rsync for other backup applications and they seem to run fine. What do you mean by microsoft filesystems don't respect modified times? I don't need to sync between the boxes, just push the files to the box.


Top
 Profile  
 PostPosted: Tue Aug 22, 2006 10:10 am   

Joined: Mon May 16, 2005 6:29 pm
Posts: 94
Location: Upstate NY
it's kinda hard to explain but m$ filesystems (specially fat16/32 and ntfs)
1, do not understand modified times like any *nix/bsd or mac's for that matter
2. they do not understand user permission the same way either.
3. the above is also true with samba mounts to a linux box.

so as a result since the file properties, permissions and modified times are not maintained in a way that rsync can understand it has to resync all the files to the remote box everytime. the only way that i have been able to see a possible way around it without buying a speciallized package is to use unison.

i have a similar scenario at my office trying to keep our working files updated with a sister company across the hall. i run linux and they run m$. i have to resync about 15gb of data over samba each time due to this file property issue. i have not tried unison yet since i don't have access to the remote box.

normally i use: "rsync -av" for all my linux to linux syncs but i have to use
"rsync -rvvtL --force" in order to sync to the remote box via samba. it's the only way i was able to reduce some of the sync time and not get any permission/property errors

it's pretty sad that i can sync 3 linux servers in different parts of the state in less than 15 minutes and it takes close to 3 hours to update a box 50ft from me.

one other option you could try is to setup a versioning server with cvs / subversion / arch. then all you would have to do is "check in" the updates from one box and then "check out" the updates to the second box. i'm just not sure how much time you can invest in this type of setup or if something like this will work with cygwin.

good luck and hth (hope this helps)

if it doesn't try to google something like "rsync ntfs cygwin" you will see piles of thread from people trying to do the same thing and it might explain the file permission issue better than i can.


Top
 Profile WWW  
 PostPosted: Tue Aug 22, 2006 10:13 am   

Joined: Mon May 16, 2005 6:29 pm
Posts: 94
Location: Upstate NY
something else to think about....are both systems sync'd with a timeserver using some type of windows utility (or a net time command to a central file/samba server) or ntp in cygwin?


Top
 Profile WWW  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 7 posts ] 

All times are UTC - 6 hours


Who is online

Users browsing this forum: No registered users and 24 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  


BashScripts | Promote Your Page Too
Powered by phpBB © 2011 phpBB Group
© 2003 - 2011 USA LINUX USERS GROUP