Below is the command to take backup of file so that backup file has datetimestamps (Date / Timestamps) in name when the file was backed up.
In above command example we are backing up testfile.out. Change this filename to the filename you want to backup. Below is example snippet which shows the backup file created with datetimestamps (highlighted in bold).
Products to which Article Applies
cp -rp testfile.out testfile.out__$(date +%F'-'%T)
In above command example we are backing up testfile.out. Change this filename to the filename you want to backup. Below is example snippet which shows the backup file created with datetimestamps (highlighted in bold).
-rw-r--r-- 1 root root 0 Sep 28 14:39 testfile.out__2019-09-28-14:39:16
-rw-r--r-- 1 root root 0 Sep 28 14:39 testfile.out
-rw-r--r-- 1 root root 0 Sep 28 14:39 testfile.out
Products to which Article Applies
No comments:
Post a Comment