AWS EC2 file sync needs timezone set. But stat file times seem wrong
Posted: Fri Nov 15, 2019 5:10 pm
Hi there.
First of all, thanks for the great tool. I have been using it for a few years (2012) now and just upgraded to 2019.
I am just starting to use AWS EC2 and I believe there is some issue with the file times after syncing.
Sync configuration:
- Folder1 is a local machine with EST timezone via FTP
- Folder2 is an AWS EC2 with UTC timezone via SFTP
When both are set to File Time: "Auto Detect", then after syncing the file times are off by a 5 hours and always need resyncing.
When Folder2 (the AWS EC2) is set to File Time: "UTC", then the syncing seems to work without showing a need to resync.
However after syncing, if i look at the file times via "stat" command or "ls -l", things don't look quite right.
For example, I started with 1 file on each side and synced both: folder1file -> folder2 and folder2file -> folder1
After the sync here are the stats of both files on both machines:
Folder1 (on local machine):
# date
Fri Nov 15 11:27:09 EST 2019
# stat folder1file --- This file did not change and so looks good.
File: `folder1file'
Size: 4 Blocks: 8 IO Block: 4096 regular file
Device: fc70b601h/4235245057d Inode: 4327686 Links: 1
Access: (0644/-rw-r--r--) Uid: ( 505/foo) Gid: ( 505/foo)
Access: 2019-11-15 11:24:25.698526407 -0500
Modify: 2019-11-15 11:23:22.799834698 -0500
Change: 2019-11-15 11:23:22.799834698 -0500
# stat folder2file --- This file was brought from Folder2 and the Modify time is wrong.
File: `folder2file'
Size: 4 Blocks: 8 IO Block: 4096 regular file
Device: fc70b601h/4235245057d Inode: 4327677 Links: 1
Access: (0644/-rw-r--r--) Uid: ( 505/foo) Gid: ( 505/foo)
Access: 2019-11-15 11:24:25.996539118 -0500
Modify: 2019-11-15 06:23:12.000000000 -0500
Change: 2019-11-15 11:24:26.023540269 -0500
NOTE: the modify date-time of folder2file (now on folder1 machine) is wrong
and "ls -l folder2file" shows:
-rw-r--r-- 1 foo foo 4 Nov 15 06:23 folder2file
Folder2 (on AWS EC2):
$ date
Fri Nov 15 16:28:10 UTC 2019
$ stat folder1file --- This file was brought from Folder1 and now the Access and Modify times are wrong.
File: folder1file
Size: 4 Blocks: 8 IO Block: 4096 regular file
Device: ca01h/51713d Inode: 259544 Links: 1
Access: (0666/-rw-rw-rw-) Uid: ( 1001/bar) Gid: ( 1001/bar)
Access: 2019-11-15 21:23:22.000000000 +0000
Modify: 2019-11-15 21:23:22.000000000 +0000
Change: 2019-11-15 16:24:25.993619929 +0000
Birth: -
$ stat folder2file --- This file did not change and so looks good.
File: folder2file
Size: 4 Blocks: 8 IO Block: 4096 regular file
Device: ca01h/51713d Inode: 259640 Links: 1
Access: (0664/-rw-rw-r--) Uid: ( 1001/bar) Gid: ( 1001/bar)
Access: 2019-11-15 16:24:26.017619741 +0000
Modify: 2019-11-15 16:23:12.398195095 +0000
Change: 2019-11-15 16:23:12.398195095 +0000
Birth: -
NOTE: the Access and Modify date-times of folder1file (now on folder2 machine) are wrong.
Also now "ls -l folder1file" shows:
-rw-rw-rw- 1 bar bar 4 Nov 15 2019 folder1file
Note that there is no time show. I believe this is because it is using the Modify time and that is now in the future.
When I "touch folder1file" then the stat and ls -l look good -- as shown:
Access: 2019-11-15 16:46:57.342874461 +0000
Modify: 2019-11-15 16:46:57.342874461 +0000
Change: 2019-11-15 16:46:57.342874461 +0000
While the sync seems to work and not need repeating in this config (Folder2 set as UTC), the file times after syncing have issues.
Please let me know if I am doing something wrong, but i don't think so.
Again, thanks for the great tool and I hope this issue can be cleared up shortly.
David.
First of all, thanks for the great tool. I have been using it for a few years (2012) now and just upgraded to 2019.
I am just starting to use AWS EC2 and I believe there is some issue with the file times after syncing.
Sync configuration:
- Folder1 is a local machine with EST timezone via FTP
- Folder2 is an AWS EC2 with UTC timezone via SFTP
When both are set to File Time: "Auto Detect", then after syncing the file times are off by a 5 hours and always need resyncing.
When Folder2 (the AWS EC2) is set to File Time: "UTC", then the syncing seems to work without showing a need to resync.
However after syncing, if i look at the file times via "stat" command or "ls -l", things don't look quite right.
For example, I started with 1 file on each side and synced both: folder1file -> folder2 and folder2file -> folder1
After the sync here are the stats of both files on both machines:
Folder1 (on local machine):
# date
Fri Nov 15 11:27:09 EST 2019
# stat folder1file --- This file did not change and so looks good.
File: `folder1file'
Size: 4 Blocks: 8 IO Block: 4096 regular file
Device: fc70b601h/4235245057d Inode: 4327686 Links: 1
Access: (0644/-rw-r--r--) Uid: ( 505/foo) Gid: ( 505/foo)
Access: 2019-11-15 11:24:25.698526407 -0500
Modify: 2019-11-15 11:23:22.799834698 -0500
Change: 2019-11-15 11:23:22.799834698 -0500
# stat folder2file --- This file was brought from Folder2 and the Modify time is wrong.
File: `folder2file'
Size: 4 Blocks: 8 IO Block: 4096 regular file
Device: fc70b601h/4235245057d Inode: 4327677 Links: 1
Access: (0644/-rw-r--r--) Uid: ( 505/foo) Gid: ( 505/foo)
Access: 2019-11-15 11:24:25.996539118 -0500
Modify: 2019-11-15 06:23:12.000000000 -0500
Change: 2019-11-15 11:24:26.023540269 -0500
NOTE: the modify date-time of folder2file (now on folder1 machine) is wrong
and "ls -l folder2file" shows:
-rw-r--r-- 1 foo foo 4 Nov 15 06:23 folder2file
Folder2 (on AWS EC2):
$ date
Fri Nov 15 16:28:10 UTC 2019
$ stat folder1file --- This file was brought from Folder1 and now the Access and Modify times are wrong.
File: folder1file
Size: 4 Blocks: 8 IO Block: 4096 regular file
Device: ca01h/51713d Inode: 259544 Links: 1
Access: (0666/-rw-rw-rw-) Uid: ( 1001/bar) Gid: ( 1001/bar)
Access: 2019-11-15 21:23:22.000000000 +0000
Modify: 2019-11-15 21:23:22.000000000 +0000
Change: 2019-11-15 16:24:25.993619929 +0000
Birth: -
$ stat folder2file --- This file did not change and so looks good.
File: folder2file
Size: 4 Blocks: 8 IO Block: 4096 regular file
Device: ca01h/51713d Inode: 259640 Links: 1
Access: (0664/-rw-rw-r--) Uid: ( 1001/bar) Gid: ( 1001/bar)
Access: 2019-11-15 16:24:26.017619741 +0000
Modify: 2019-11-15 16:23:12.398195095 +0000
Change: 2019-11-15 16:23:12.398195095 +0000
Birth: -
NOTE: the Access and Modify date-times of folder1file (now on folder2 machine) are wrong.
Also now "ls -l folder1file" shows:
-rw-rw-rw- 1 bar bar 4 Nov 15 2019 folder1file
Note that there is no time show. I believe this is because it is using the Modify time and that is now in the future.
When I "touch folder1file" then the stat and ls -l look good -- as shown:
Access: 2019-11-15 16:46:57.342874461 +0000
Modify: 2019-11-15 16:46:57.342874461 +0000
Change: 2019-11-15 16:46:57.342874461 +0000
While the sync seems to work and not need repeating in this config (Folder2 set as UTC), the file times after syncing have issues.
Please let me know if I am doing something wrong, but i don't think so.
Again, thanks for the great tool and I hope this issue can be cleared up shortly.
David.