Using TAR to create backup of files created today in data directory
Using TAR command is it possible to take backup of files created today??
played around with ->
find . -mtime -1 -type f -print > $INPUT_FILE
for i in $(cat $INPUT_FILE); do
echo "line: $i";
tar --append --file=$OUTPUT_FILE $i
it gives me a strange and different error everytime.. any suggestions on improving the script?
This script doesn't seem to be complete. Please paste the complete script and also paste the error message.
i think below will help u
find . -mtime -1 -type f |xargs tar cvzf test.tar
Yes, using tar command it is possible to take backup of files created today. I will give you an example of my shell script which I use for creating backup every sunday.
This is the example of my case on my server which I use it:
I had automated a little shell script that basically mounts my backup drive, checks the date, every sunday it makes a full backup of some datafiles and some configuration settings, older incremental backups are removed. other days it backups files that have been accessed the last day and at last it unmounts the backup drive.
And here is the code which I use:
|All times are GMT -5. The time now is 02:43 PM.|