I am working on a bash script and I am not getting the desired results.
My script is set up as such:
Code:
#!/bin/bash
tar -cjf $BACKUPDIR/folder1-$DATE.tar.bz2 $HOMEDIR/folder1/
tar -cjf $BACKUPDIR/folder2-$DATE.tar.bz2 $HOMEDIR/folder2/
When I run it, I get this error:
Code:
Removing leading `/' from member names
Also, when I open the directory, it saves every parent directory. So it will show /home/me/folder1 instead of only having 'folder1' as the root folder in the archive.
How can I fix this so I don't get this error and tar up the files so 'folder1' and 'folder2' are the root directories?
Thanks!