Maybe this could be an inspiring moment to write a script. Rename the
tar command as
tar.orig, and name your new script
my-tar.sh. Have your new
- perform a sanity check as to which is input and which is output (check .ext? filesize? date-time stamp?), then
- create a backup of your input file (
cp input.bkp) before any processing is done.
You could also include a small piece of menu, configured to easily select between your favorite tar command option sets!
If you're feeling truly robust, you could also have your script rotate several backup files of each of your most recent 'runs' (using
/tmp dir; .bkp, .bk4, .bk3, .bk2, .bk1), just in case you manage a good bit of keyboard-madness before that first cup-o-joe! Maybe also rotate a small log file as
/var/log/my-tar.log to track date & time stamps and exact script-processed command line of what was executed during each of the last several 'runs' of your customized script!
For help with writing the
mytar.sh script, bite the bullet and go the educational route: grab yourself an online PDF of "Advanced Bash-Scripting Guide" from The Linux Documentation Project. You'll be worlds ahead of the rest by spending the time to learn how to handle many script-needy situations - before they bite you from behind!