Originally Posted by T3RM1NVT0R
Welcome to LQ!!!
Here is how your script should go:
1. It should create an archive using tar -cvf say: tar -cvf foldter.tar.gz folder_name
2. Script should look for folder.tar.gz. If it already exist then does not create a new one just echo that folder existing and continue with the next step.
3. If folder.tar.gz exist then you can append to it using tar -rf folder.tar.gz folder_name
It will be good if you would have pasted the script that you have already prepared.
I'm still new to linux in general and bash scripting. I may need to consult other resources to find out the basics of how to write a bash script.
My bash script will be structured as follows,
echo back up start 'date' >> ~/backuplog
mkdir /home/user/Desktop/backups/' date +%Y%m%d'
tar -czf /home/user/Desktop/backups/' date +%Y%m%d'/data.tar.gz/data
echo this back up has completed ' date' >> ~/backuplog
For whatever reason though, this is currently not working.