I am doing a simple [1]backup Bash script that creates a backup archive of a
folder (or file) I am working on. I want to have snapshaps all saved to one
directory. To ensure unique name, I am currently appending the date and time
to "MyArcName_data_time." But this creates a long and ugly name. I'd like
either something cleaner like a unique number appended (based on total files
in directory), or some random temp filename generator function that I don't
yet know about.
The count would be sufficient, as each folder will always hold ONLY these
archives, and no hidden files.
Thus, my directory would be:
myArcName_1.tar.gz
myArcName_2.tar.gz
myArcName_3.tar.gz
...
iF there's some bash function for this, groovy. If not, i just need to know
how to count the directories from inside my script.
Thanks in advance
References
1. http://www.linuxforums.org/forum/