Programmer's Cookbook

Recipes for the practical programmer

Wednesday, January 03, 2007

 

Create tar files with date and time stamp

There are many different tools to deploy files or directories of files from server to server. There's tar, rsync, remote copy ... a bunch of things. Whichever method you use, it's in your best interests to make a backup.

To help you keep track of the backups you make at any time, use "date" along with "tar" to create timestamped files:

tar -cvfX filename_`date +%Y%m%d_%H%M%S`.tar *

example:

# find .
./somedir
./somedir/a.txt
./b.txt
./c.txt

# tar -cvfX filename_`date +%Y%m%d_%H%M%S`.tar *
a build.sh 0K
a c.txt 0K
a somedir/ 0K
a somedir/a.txt 0K


# ls *.tar
filename_20070103_101105.tar


Now, if you need to back out the tar file you explode you can just go get your previously dated version.

Comments:
This is my 1st visit to your web... But I'm so impressed with your content. Good Job!
python Training institute in Pune
python Training institute in Chennai
python Training institute in Bangalore

 
Your good knowledge and kindness in playing with all the pieces were very useful. I don’t know what I would have done if I had not encountered such a step like this.
python training Course in chennai
python training in Bangalore
Python training institute in bangalore
 
Thank you for allowing me to read it, welcome to the next in a recent article. And thanks for sharing the nice article, keep posting or updating news article.
AWS training in chennai

AWS Training in Bangalore

 


Excellant post!!!. The strategy you have posted on this technology helped me to get into the next level and had lot of information in it. devops training in chennai | devops training in anna nagar | devops training in omr | devops training in porur | devops training in tambaram | devops training in velachery




 
Really it is very important and super post to all. I keep visiting this blog form now. Thank you for post such a wonderful information.

Java training in Chennai

Java training in Bangalore

Java training in Hyderabad

Java Training in Coimbatore

Java Online Training


 
Thank you for allowing me to read it, welcome to the next in a recent article. And thanks for sharing the nice article, keep posting or updating news article.
angular js training in chennai

angular js training in omr

full stack training in chennai

full stack training in omr

php training in chennai

php training in omr

photoshop training in chennai

photoshop training in omr


 
Infycle offers the solitary AWS training in Chennai for the freshers, professionals, and students along with the additional course such as DevOps Training and Java training for making the candidate an all-rounder in the Software domain field. For a lucrative career, dial 7504633633, 7502633633.

 
Post a Comment



<< Home

This page is powered by Blogger. Isn't yours?