Bash script to archive different files and folders into a single folder which will be named using current timestamp
I use this script to back up files that are created in different locations. I feel easy to collect all the related files and folders to compress and save them as a single zip archive which is named as per the current date and time. #!/bin/bash # this program creates a zip archive of myFolder(containing files and folders), file1 , file2 , file3 and file4 and puts the archive in myOpDir. The name of the final zip archive will be given by the current timestamp. For eg : final_20111220_103015.zip #create a directory for putting all the files myFolder="/home/user/Desktop/myFolderWithContents" myOpDir="/home/user/Desktop/myFinalDir" file1="/home/user/Desktop/test.tcl" file2="/home/user/Desktop/test.dump.xml" file3="/home/user/Desktop/myDir/test.txt" file4="/home/user/Desktop/myDir/test.txt.xml" mkdir $myOpDir/temp # copy the files and folder to to temp dir cp -r $myFolder $myOpDir/temp/` cp $file1 $myOpDir/temp/test.tcl cp $fil...