Create a "relative path" tar-archive?
For lack of actually knowing what I'm asking, let me explain.
When I do Code:
tar -zcf archive.tar.gz /some/path/to/a/dir /some/path/to/a/dir and then files. How can I make is so the root of the archive is the actual directory I'm archiving. I suppose another way of saying this would be: How can I not archive the parent directories. |
use relative paths when creating it
Code:
cd / |
Quote:
|
write a script and have cron call the script
|
You can also use the -C option to first change to the directory, then specify the files.
Such as "tar -C /some/path/to/a/dir -zcf <full path to>/archive.tar.gz ." If you wanted the "dir" to be part of the archive, then use "tar -C /some/path/to/a/ -zcf <full path to>/archive.tar.gz dir" |
Quote:
|
All times are GMT -5. The time now is 08:20 PM. |