Help using tar!
Posted: Thu Aug 05, 2004 11:04 am
Hi all,
Sorry if this is in the wrong place, I wasn't sure what category "tar" would come under. I have used tar before to backup an entire site in one go, just specifying to start in the route directory. But now I need to just backup a few different files from various places within the directory structure. So first of all I just want to check, it is possible to just add singular files to the archive file isn't it? Just by listing off the filenames instead of giving one directory?
Assuming I'm right about being able to do that, my other problem is that when I put these individual files into the archive, I need to put them into directories. So it may be in /this/handy/folder on the website, but needs to be in /this/backup/folder in my archive. So is it possible to state the filename to archive followerd by the folder to put it in when it's archived?
Or, if that's not possible, can I at least rename the files before they are put into the archive, but still preserving the names of the original files? So it's called myfile.php on the server, but mybackupFile.php in my archive.
If I can't do any of this then the only thing I can think of is to create the directories that I need, copy the files into those relevant directories, add the directories to the tar file, and then delete those copied files and new directories. Much more messy though, so any suggestions are welcome!
Thanks
Sorry if this is in the wrong place, I wasn't sure what category "tar" would come under. I have used tar before to backup an entire site in one go, just specifying to start in the route directory. But now I need to just backup a few different files from various places within the directory structure. So first of all I just want to check, it is possible to just add singular files to the archive file isn't it? Just by listing off the filenames instead of giving one directory?
Assuming I'm right about being able to do that, my other problem is that when I put these individual files into the archive, I need to put them into directories. So it may be in /this/handy/folder on the website, but needs to be in /this/backup/folder in my archive. So is it possible to state the filename to archive followerd by the folder to put it in when it's archived?
Or, if that's not possible, can I at least rename the files before they are put into the archive, but still preserving the names of the original files? So it's called myfile.php on the server, but mybackupFile.php in my archive.
If I can't do any of this then the only thing I can think of is to create the directories that I need, copy the files into those relevant directories, add the directories to the tar file, and then delete those copied files and new directories. Much more messy though, so any suggestions are welcome!
Thanks