LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 08-12-2013, 09:35 AM   #1
Jeff9
Member
 
Registered: Jun 2013
Posts: 36

Rep: Reputation: Disabled
rsync updating time


I'm using rsync to store backups of my code on a common server, and it seems like its updating the date/time stamp of each file, which it's not supposed to do.

Because of the work I'm doing, I have similar in two place: one on my PC and one on a Linux cluster. There is another Linux machine between them (a passthru machine).

Every few days I make a zip file of the code on my PC and a separate zip file of the code on the cluster. Then I use rsync to copy the zip file from the cluster to the passthrough server

Code:
passthru> rsync -uv cluster:~/mycode/backups/*.zip .
and I use Winscp to copy the zip files from my PC to the same directory.

Since I want the PC files also to reside on the cluster, I return to the cluster and use rsync to call retreive all of the zip files

Code:
cluster> rsync -uv passthru:~/mycode/backups/*.zip .
But rsync on the cluster copied all of the files and updated their date. Not only that, but since rsync did that last time, too, it also copied all of the zip file from the cluster back down to the passthrough, first. In other words, every file is being copied every time.

WinSCP has a "New and updated files only" option, which I use, and it seems to keep the dates and times intact.

Why is rsync updating all of the dates? How do I get it to stop (I already looked at rsync --help)?
 
Old 08-12-2013, 09:41 AM   #2
szboardstretcher
Senior Member
 
Registered: Aug 2006
Location: Detroit, MI
Distribution: GNU/Linux systemd
Posts: 4,208

Rep: Reputation: 1611Reputation: 1611Reputation: 1611Reputation: 1611Reputation: 1611Reputation: 1611Reputation: 1611Reputation: 1611Reputation: 1611Reputation: 1611Reputation: 1611
There is a switch --ignore-dates

edit: i meant --ignore-times

Last edited by szboardstretcher; 08-12-2013 at 09:54 AM.
 
Old 08-12-2013, 09:45 AM   #3
Jeff9
Member
 
Registered: Jun 2013
Posts: 36

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by szboardstretcher View Post
There is a switch --ignore-dates
I only see an switch called "--ignore-times", and it looks like it's going to do the opposite of what I want.

P.S. Why can't they list the damn options in alphabetical order or something? Sheesh!
 
Old 08-12-2013, 09:51 AM   #4
szboardstretcher
Senior Member
 
Registered: Aug 2006
Location: Detroit, MI
Distribution: GNU/Linux systemd
Posts: 4,208

Rep: Reputation: 1611Reputation: 1611Reputation: 1611Reputation: 1611Reputation: 1611Reputation: 1611Reputation: 1611Reputation: 1611Reputation: 1611Reputation: 1611Reputation: 1611
You can do this test to ensure that Rsync is actually working correctly. Because it only copies files based on "Modify time" and does not update that when copying.

pick a file. any file.

stat that_file

rsync -vvvvvarh that_file /dev/shm

stat /dev/shm (note the times)

rsync -vvvvvarh that_file /dev/shm(note in the output, that it did not in fact copy the file again)

The reason I mention /dev/shm directory, is so that you don't run into any funny filesystem settings that re-write times on copy.
 
Old 08-12-2013, 10:07 AM   #5
Jeff9
Member
 
Registered: Jun 2013
Posts: 36

Original Poster
Rep: Reputation: Disabled
On both the cluster and the passthrough, the Access and Change date of the new file (the one in /dev/shm) was updated. But the Modify date was unchanged.

Code:
cluster>rsync -vvvvvarh clusterModifiedBackup.zip /dev/shm
cluster>stat clusterModifiedBackup.zip
Access: 2013-08-12 10:18:47.565507994 -0400
Modify: 2013-08-12 10:18:47.565507994 -0400
Change: 2013-08-12 10:18:47.565507994 -0400

cluster> stat /dev/shm/clusterModifiedBackup.zip
Access: 2013-08-12 11:03:22.000000000 -0400
Modify: 2013-08-12 10:18:47.000000000 -0400
Change: 2013-08-12 11:03:22.160311939 -0400
Does that mean it's working correctly?
 
Old 08-12-2013, 10:14 AM   #6
szboardstretcher
Senior Member
 
Registered: Aug 2006
Location: Detroit, MI
Distribution: GNU/Linux systemd
Posts: 4,208

Rep: Reputation: 1611Reputation: 1611Reputation: 1611Reputation: 1611Reputation: 1611Reputation: 1611Reputation: 1611Reputation: 1611Reputation: 1611Reputation: 1611Reputation: 1611
Quote:
Originally Posted by Jeff9 View Post
On both the cluster and the passthrough, the Access and Change date of the new file (the one in /dev/shm) was updated. But the Modify date was unchanged.

Code:
cluster>rsync -vvvvvarh clusterModifiedBackup.zip /dev/shm
cluster>stat clusterModifiedBackup.zip
Access: 2013-08-12 10:18:47.565507994 -0400
Modify: 2013-08-12 10:18:47.565507994 -0400
Change: 2013-08-12 10:18:47.565507994 -0400

cluster> stat /dev/shm/clusterModifiedBackup.zip
Access: 2013-08-12 11:03:22.000000000 -0400
Modify: 2013-08-12 10:18:47.000000000 -0400
Change: 2013-08-12 11:03:22.160311939 -0400
Does that mean it's working correctly?
This is typical Rsync behaviour. It doesnt copy based on Access/Change, im sure a python programmer could look at the source and truly verify. My statement comes from using rsync *for* *ever*.

Now,. as to your code. Storing backups of... plain-text code? Don't you have that in subversion/git/cv..cv..cv(i cant even bring myself to type it) because that is the best place for it, for just such reasons.

Also,.. are your computers in time-sync?
 
Old 08-12-2013, 10:21 AM   #7
Jeff9
Member
 
Registered: Jun 2013
Posts: 36

Original Poster
Rep: Reputation: Disabled
No, we don't have a code versioning system on the cluster. This is a bare bones operation - also known as the math department of a university. The system administrator has a Ph.D. in math, but not in computers (if you get my meaning), and does as little with or to the system as he can. To backup my code, I have to do it myself.

So I'm still left wondering why rsync changed the dates when I copied from another machine? I did the following from the cluster. Notice that all the dates were changed!

Code:
cluster> cd /dev/shm
cluster> rsync -uv passthru:~/mycode/backups/clusterModifiedBackup.zip .
cluster> stat clusterModifiedBackup.zip
Access: 2013-08-12 11:18:56.917238467 -0400
Modify: 2013-08-12 11:18:56.917238467 -0400
Change: 2013-08-12 11:18:56.917238467 -0400
Edit: I did the same on passthru - that is, I copied the file from cluster:~/mycode/backups/clusterModifiedBackups.zip to /dev/shm. Same results - all three dates were changed.

I guess rsync just updates the dates when you transfer across servers.

Last edited by Jeff9; 08-12-2013 at 10:23 AM.
 
Old 08-12-2013, 10:24 AM   #8
szboardstretcher
Senior Member
 
Registered: Aug 2006
Location: Detroit, MI
Distribution: GNU/Linux systemd
Posts: 4,208

Rep: Reputation: 1611Reputation: 1611Reputation: 1611Reputation: 1611Reputation: 1611Reputation: 1611Reputation: 1611Reputation: 1611Reputation: 1611Reputation: 1611Reputation: 1611
Quote:
Originally Posted by Jeff9 View Post
No, we don't have a code versioning system on the cluster. This is a bare bones operation - also known as the math department of a university. The system administrator has a Ph.D. in math, but not in computers (if you get my meaning), and does as little with or to the system as he can. To backup my code, I have to do it myself.

So I'm still left wondering why rsync changed the dates when I copied from another machine? I did the following from the cluster. Notice that all the dates were changed!

Code:
cluster> cd /dev/shm
cluster> rsync -uv passthru:~/mycode/backups/clusterModifiedBackup.zip .
cluster> stat clusterModifiedBackup.zip
Access: 2013-08-12 11:18:56.917238467 -0400
Modify: 2013-08-12 11:18:56.917238467 -0400
Change: 2013-08-12 11:18:56.917238467 -0400
My example above,.. the switches mean this:

-vvvv = verbose, so you can see whats going on
-a = archive, equals -rlptgoD
-r = reccursive
-h = human readable

If you break all that down, it says "I will not change your modify times," so that "Rsync will work correctly"

Last edited by szboardstretcher; 08-12-2013 at 10:27 AM.
 
Old 08-12-2013, 10:29 AM   #9
Jeff9
Member
 
Registered: Jun 2013
Posts: 36

Original Poster
Rep: Reputation: Disabled
OK, you're saying I need the -a option. I tried copying across servers, adding -a, and the modify date did not update. Whew!
Thanks.
 
Old 08-13-2013, 04:28 AM   #10
jpollard
Senior Member
 
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 4,702

Rep: Reputation: 1270Reputation: 1270Reputation: 1270Reputation: 1270Reputation: 1270Reputation: 1270Reputation: 1270Reputation: 1270Reputation: 1270
Quote:
Originally Posted by Jeff9 View Post
OK, you're saying I need the -a option. I tried copying across servers, adding -a, and the modify date did not update. Whew!
Thanks.
You were missing the -t option (preserve modification time). The -a option is equivalent to specifying the options -rlptgoD.

Last edited by jpollard; 08-13-2013 at 04:30 AM.
 
Old 04-26-2014, 01:49 PM   #11
Jeff9
Member
 
Registered: Jun 2013
Posts: 36

Original Poster
Rep: Reputation: Disabled
(Just cleaning up old threads now that I realize you all want solved threads marked as "solved".)

Using rsync -utv from the passthrough server works for me. But using it from the cluster may still not be working right.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
rpm changes are not updating immediately and updating after some time. shri_22ram Linux - Newbie 1 05-13-2013 12:50 PM
rsync without copying files when the only difference is the time time centguy Linux - Mobile 2 12-01-2012 08:15 PM
Updating Rsync to version 3.0.4 Rudy Red Hat 4 08-26-2009 05:22 PM
rsync not doinf its jub updating bird603568 Slackware 9 06-25-2005 12:19 PM
Rsync not updating properly? Phaethar Linux - Software 0 11-04-2004 08:45 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 05:38 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration