I am having difficulty trying to backup my 'my_work' directory into my destination 'Backup' directory. I tried running the script, but it does not seem to work. This is the script that I have written :
#!/bin/bash
SRCDIR="/home/student/Documents/my_work/"
DESTDIR="/home/student/Backups/"
FILENAME=backup1-$(date +%-Y%-m%-d)-$(date +%-T).tgz
tar --create --gzip --file=$DESTDIR $FILENAME $SRCDIR
This is the output I received :
tar: backup1-201576-10\:24\:17.tgz: Cannot stat: No such file or directory
tar: Removing leading '/' from member names
tar (child): /home/student/Backups/: Cannot open: Is a directory
tar (child): Error is not recoverable: exiting now
tar: Child returned status 2
tar: Error is not recoverable: exiting now
I can't seem to find a solution to this, please help