Forum archive
how to retain Date Modified when copying files in linux?
Hi guys!
I got a TKL Fileserver up and running for almost 6 months now. I am using a cron job to create a local backup of samba shares. I have noticed that the Date Modified of created backup files is the date when the files were created.
cron job: cp -R /mnt/fileserver/File-server /mnt/backup
I'm just wondering if I could leave the Dated Modified of the backup files same with the original files.
Thanks in advance!
No doubt there is a way. Perhaps if you tar the files first (not sure if that'd work?) Another work around may be to rename the file to reflect the backup. Just remember that TKL is Ubuntu under the hood so anything that applies to Ubuntu (and to some extent Debian too) should apply to TKL.