...
Code Block | ||
---|---|---|
| ||
# To tar the directory sudo tar -zcvpf tarfile.tar.gz ./folder # To untar and gunzip the file in one command sudo tar -zxvpf tarfile.tar.gz # Encrypting a tar ... |
Info |
---|
Explanation about why - v does not work in a script without output to file. |
Using tar in a backup script run in cron
Code Block | ||
---|---|---|
| ||
sudo tar -zcpf $BACKUPDIR/nameofbackupfile.tar.gz /path/to/directory && echo "Completed OK" > /home/user/log.txt |