I am one of those type of people that like to make backup copies of files before I tinker with them, especially when I am modifying important files like system stuff. It’s always a good idea to make a backup copy before you edit something so you can put it back if you break it. For that reason, I wrote this simple little PERL script that I then put somewhere in my path so I can run it from anywhere. I call it simply “bu” so that it’s easy to type and use. What it does is copy the target file you specify, to a file of the same name only with a date stamp appended to it. I have found this to be a really handy tool, so I thought I would share.
Take a look at the script here.
Check it out, I hope you find it as useful as I have.
You are putting into practice here one of the cardinal rules of systems administration.. always create a path to return … just in case you break something when making changes. I always make a backup of config files before making changes, but it never dawned on me to create a script that could make this backup with a timestamp. This is very, very nifty. THANK YOU.
Pingback: Simple Perl Script at mts/blog
I like to think I can get out of trouble, quicker than I got into it. At least I try to. 🙂 So when making changes to s system, I want to be able to put back whatever I just did. It has saved my tail on many occasions.
yep me too. Especially with httpd.conf and procmailrc