LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
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-19-2018, 08:01 PM   #1
Davno
Member
 
Registered: Mar 2004
Location: Montreal, Canada
Distribution: Linux MX 23 KDE "Libretto"
Posts: 222

Rep: Reputation: 25
rsync script problem


Hi,
I have a rsync backup script that use to work well, but when i run it onto a new target drive (portable usb drive), it keeps writing the source to the target directory all over every time, even when there is no change made.
If i run the script a second time without unmounting the target, it is ok, it just check.
The problem happen when i umount and mount again the portable usb drive.

I saw on google that may be rsync does not keep time/date of the files and rewrite everything.

P.S. No change was made to the script in years except for the UUID of the new drive.
P.S. This xfr#229 does mean it is being transfered? (xfr#229, ir-chk=1237/1780)

Code:
if [ -f /media/normand/1F16-AC89/500GigMounted ]

then
rsync -t -r -h --delete --progress --partial-dir=DIR --stats /media/normand/8d3f4d22-b6fb-4750-ba52-c2e2b484f43e/LinuxStuff /media/normand/1F16-AC89
rsync -t -r -h --delete --progress --partial-dir=DIR --stats /media/normand/8d3f4d22-b6fb-4750-ba52-c2e2b484f43e/PersonnelStuff /media/normand/1F16-AC89
rsync -t -r -h --delete --progress --partial-dir=DIR --stats /media/normand/8d3f4d22-b6fb-4750-ba52-c2e2b484f43e/Photos /media/normand/1F16-AC89
rsync -t -r -h --delete --progress --partial-dir=DIR --stats /media/normand/8d3f4d22-b6fb-4750-ba52-c2e2b484f43e/Video /media/normand/1F16-AC89
fi

Last edited by Davno; 08-19-2018 at 08:46 PM.
 
Old 08-19-2018, 08:25 PM   #2
Davno
Member
 
Registered: Mar 2004
Location: Montreal, Canada
Distribution: Linux MX 23 KDE "Libretto"
Posts: 222

Original Poster
Rep: Reputation: 25
Oopss May be i should have Googled some more before posting :)

UPDATE:
Forgot to mention that the (OLD) target drive was formated in NTFS and the (NEW) target drive is FAT32.
While Googling some more i realised that somebody had the exact same problem, and he add this (--modify-window 1) to the script and it did the trick.

rsync manpage
Code:
       --modify-window
              When comparing two timestamps, rsync treats the timestamps as being equal if they differ by no more than  the  modify-window  value.
              This  is  normally  0  (for  an  exact  match),  but  you  may  find it useful to set this to a larger value in some situations.  In
              particular, when transferring to or from an MS Windows FAT filesystem (which represents times with a  2-second  resolution),  --mod-
              ify-window=1 is useful (allowing times to differ by up to 1 second).
I think i will just format that drive to NTFS like it used to be and i'll keep you posted.
 
Old 08-19-2018, 11:02 PM   #3
Davno
Member
 
Registered: Mar 2004
Location: Montreal, Canada
Distribution: Linux MX 23 KDE "Libretto"
Posts: 222

Original Poster
Rep: Reputation: 25
Fixed (may be it will be usefull for somebody in the future)

I don't think i understand exactly what rsync manpage says about FAT filesystem (which represents times with a 2-second resolution) but i did not want to add another option (--modify-window 1) to my script, so i formatted back to NTFS and everything works nicely now.
 
  


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
[SOLVED] Rsync script problem RayLui20 Linux - Newbie 5 04-30-2015 11:31 AM
Need someone to look at rsync script JosephS Linux - Software 1 04-26-2015 05:50 PM
Rsync script help lleb Linux - Software 17 11-18-2011 03:30 PM
[SOLVED] Problem Getting rsync Script to run gjblackford Linux - General 7 02-25-2011 02:04 PM
how to write a script to know problem in network(rsync is going on) abhishekrahel Linux - Server 4 10-24-2008 12:37 AM

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

All times are GMT -5. The time now is 11:47 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