LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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 02-11-2021, 12:37 AM   #16
MadeInGermany
Senior Member
 
Registered: Dec 2011
Location: Simplicity
Posts: 2,816

Rep: Reputation: 1211Reputation: 1211Reputation: 1211Reputation: 1211Reputation: 1211Reputation: 1211Reputation: 1211Reputation: 1211Reputation: 1211

You can preserve the mtime and the atime.
The ctime is always to date, telling the last manipulation of the inode.
 
Old 02-13-2021, 07:18 AM   #17
Jezekilj Monk
LQ Newbie
 
Registered: Dec 2019
Location: Kosovo - Serbia
Distribution: Linux Mint 20.3 Cinnamon, Ubuntu 20.04 LTS, Ubuntu-mate 20.04 LTS on RPi4, Win7, Win10 as VM
Posts: 15

Rep: Reputation: Disabled
Hello Varaonaid,

I had that problem too when I first switched to Linux Mint from Win 7. I wrote a very long text about that period (Transition from Win7 to LinuxMint my first month) but you don't need to read that post since this is the excerpt that concerns your question of batch changing the time stamps inside a folder and it's subfolders and all of the files therein to one particular time stamp.

this was the code from Terminal

$ find -print | while read filename; do
> touch -a -m "2020-01-13 15:00:00" "$filename;
> done

Just make sure you run it from Terminal opened inside the Folder where you want to change everything to the same time stamp (with all files and subfolders recursively). The given format was needed for Linux Mint (put your own date and time instead as this only serves as guideline), even some of the formats mentioned in man touch pages did not produce any result so I give one format that was accepted.

But before I switched all my files and folders to the same time stamp I first used FreeFileSync with option to check for file content while comparing source and target folders and made sure these are properly synced I kept using FreeFileSync after that but with option to just check for file size and time stamp (works way faster once you are sure you lose nothing). Whenever I have two options to do the same thing both from the Terminal and from a GUI application, I always choose the GUI but it's up to you.

Separate topic when you are syncing folders is also to make sure that PCs on both ends of the syncing process use same time synchronization (either from a Network Time Server or Local Server who can serve as a time server. You will find a lot of posts yourself if this should be needed.
 
Old 02-13-2021, 07:33 AM   #18
JeremyBoden
Senior Member
 
Registered: Nov 2011
Location: London, UK
Distribution: Debian
Posts: 1,947

Rep: Reputation: 511Reputation: 511Reputation: 511Reputation: 511Reputation: 511Reputation: 511
The Times They Are a-Changin' ...
 
  


Reply

Tags
batch, modification, timestamp



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
script to timestamp files with timestamp from directory eRJe Programming 4 11-13-2013 06:52 PM
copy all the files in the directory based on the modification date SriniKlr Programming 4 01-26-2011 10:08 AM
[SOLVED] copying files according to modification date and extension SriniKlr Linux - Newbie 5 01-03-2011 03:45 AM
[SOLVED] merge files by creation/modification date? andre.fm Linux - Newbie 5 10-04-2010 06:41 PM
copy folder/files according to modification date bkcreddy17 Programming 14 10-15-2008 07:24 PM

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

All times are GMT -5. The time now is 06:19 AM.

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