I have to a create directory backups of selected directories; each backup should have only one root directory; if multiple directories are selected, then each of them should be stored in a separate backup. Backups should use tar and gzip. I wrote a script that should somewhat achieve this but I keep getting an error that cannot stat:
no such file name or directory
Code:
DATE=$(date +"%d-%b-%Y")
cd ~/comp232/lab5
tar zcvf lab5-$DATE.tgz lab5
mv *.tgz ~/Documents
I have Been looking up the problem online but the solutions I've tried such removing the hyphen between tar and zcvf does not work.
Any help would be appreciated.
./
in front of the script name, for example./script.sh