I'm wanting to tar a folder called "mysite" to the destination directory: /var/backups/
I'm trying to issue the following command:
tar -C /var/www/mysite/ -zcf mysite_$(date +%y%m%d).tar.gz /var/backups/
However, it's ending up with:
tar: C: Cannot stat: No such file or directory
tar: Removing leading `/' from member names
tar: Exiting with failure status due to previous errors
I've checked and confirmed that /var/backups/ is a valid directory.
Basically what I want to do is, to tar the mysite folder "/var/backup/mysite" into a file called mysite_yymmdd.tar.gz which sould be available in /var/backups/
I'm not exactly sure what you want but you can just put the destination in the path
tar -zcf /var/backups/mysite_$(date +%y%m%d).tar.gz /var/www/mysite/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With