How do I select destination directory for tar command
Hello,
I'm wanting to tar a folder called "mysite" to the destination directory: /var/backups/ I'm trying to issue the following command: Quote:
ta Quote:
Would really appreciate some help on this, pls. |
Lots of help can be found by searching the web but the basic syntax is:
tar options -f archive_name directory-name Where directory-name is the directory of the files to be archived and not the destination for the tar file. The -C option basically performs a cd to that directory. So I assume this is what you are trying to accomplish. tar -C /var/backups/ -zcf mysite_$(date +%y%m%d).tar.gz /var/www/mysite/ |
I would just omit the -C option (in fact I am doing that in my backup script) and run the command this way:
Code:
tar -zcf /var/backup/mysite_$(date +%y%m%d).tar.gz /var/www/mysite/ |
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/
|
That is exactly what the command I posted does.
|
Mine too :)
|
Quote:
|
All times are GMT -5. The time now is 08:00 PM. |