Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I run the following rsync command to back up my data. I am on Ubuntu 12.04.

rsync -rt --delete --links --exclude-from '/home/john/rsync-exclude.txt' /media/data/ server:/backup/data

The data partition is NTFS formatted and mounted via /etc/fstab as follows.

UUID=371EB137049A5349 /media/data ntfs defaults,umask=007,uid=1000,gid=1000 0 0

The target disc is a RAID formatted with ext4.

Some of the files, however, seem to have the wrong time stamp which results in the following error message.

Time value of /media/data/20090513/090513_185507.jpg truncated on receiver.
Time value of /media/data/20090513/090513_194115.jpg truncated on receiver.
rsync error: some files/attrs were not transferred (see previous errors) (code 23) at main.c(1070) [sender=3.0.9]

Here is what the files look like on the source disc.

-rwxrwx--- 2 john 2.0M May 13  2009 090513_185357.jpg
-rwxrwx--- 2 john 1.5M May 13  2009 090513_185458.jpg
-rwxrwx--- 2 john 1.6M Jul 29  28617 090513_185507.jpg <---
-rwxrwx--- 2 john 1.8M May 13  2009 090513_185520.jpg
-rwxrwx--- 2 john 2.4M May 13  2009 090513_194047.jpg
-rwxrwx--- 2 john 2.2M May 13  2009 090513_194101.jpg
-rwxrwx--- 2 john 2.1M Jul 29  28617 090513_194115.jpg <---
-rwxrwx--- 2 john 2.4M May 13  2009 090513_194135.jpg

This is what the file look like on the target disc.

-rwxr-x---    1 root     root       1863446 May 13  2009 090513_185357.jpg
-rwxr-x---    1 root     root       1863446 May 13  2009 090513_185458.jpg
-rwxr-x---    1 root     root       1573733 Aug  8 04:18 090513_185507.jpg <---
-rwxr-x---    1 root     root       1863446 May 13  2009 090513_185520.jpg
-rwxr-x---    1 root     root       2504805 May 13  2009 090513_194047.jpg
-rwxr-x---    1 root     root       2297826 May 13  2009 090513_194101.jpg
-rwxr-x---    1 root     root       2147897 Aug  8 04:18 090513_194115.jpg <---
-rwxr-x---    1 root     root       2455909 May 13  2009 090513_194135.jpg

Should I try to fix the time stamp of the files or should I add some option to rsync? Whatever you recommend, please give reasons and provide the relevant commands to do so.

share|improve this question

1 Answer 1

up vote 3 down vote accepted

That date in 28617 is clearly wrong, which is reason alone to fix it. Furthermore, it's outside the range 1970–2038, which is the range of dates that are universally supported. And in particular, it's outside the range supported by ext4 (1901–2514). So you won't be able to store that date on the target system, no matter what tool you use.

You can set the files to today's date:

touch 090513_185507.jpg 090513_194115.jpg

or to the date of the other files that were probably produced around the same time:

touch -r 090513_185458.jpg 090513_185507.jpg 090513_194115.jpg

If you have many files with a date in the far future, all of them in a directory whose name represents a date:

find /media/data -mtime --1 -execdir sh -c 'touch -d "${PWD##/*}" -- "$@"' _ {} +
share|improve this answer
    
Please include in your answer how you would fix the date. –  JJD Sep 6 '12 at 8:41
    
@JJD That depends how many files are affected and what the exact layout is, which you didn't specify in your question. I've included a few commands, one of them or something similar should do the trick. –  Gilles Sep 6 '12 at 13:21
    
It works very well. I used touch -r to apply the timestamp. Thank you once again. –  JJD Sep 29 '12 at 12:00

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.