Web Hosting Talk







View Full Version : Telnet Question


WreckRman2
04-20-2001, 10:25 AM
Does anyone know how I can, via Telnet, create a zip or tar file with the contents of a folder. Example I want to tar the contents of /home/sites/ as a second backup that I can download. I'm pretty sure you can do this but not 100% sure.

:homer:

Juan
04-20-2001, 11:05 AM
tar -cpPf tarfile.tar /home/sites/site1/*

then to make it a tar.gz

gzip -9 -S .gz tarfile.tar

grtz,

Juan

projo
04-20-2001, 11:19 AM
The tar command will most likely do what you want. Type "info tar" (without the quotes) for more details or "man tar" for harder to understand details.

Examples: (Examples are with RedHat. Your mileage may vary)

tar cvf ./sav.tar ./index.html
This command creates a new tar file and stores index.html in it.
c -Create a new tar file. In this case sav.tar
v - Be verbose in listing actions
f - Store/extract activity indicated

tar rvf ./sav.tar ./somefile.html
This command adds somefile.html to an existing
tar file. You can also add complete directories.
r - append to an existing tar file.


(Edit: Juan's reply is good and if I had noticed it during my interrupted edit I would not have posted. Juan and the manual specify the "-" with the options. Some versions seem to work without it. The "./" is not always required but the current directory is not necessarily in the path and the use is a good habit. This command has many options.)

WreckRman2
04-20-2001, 03:21 PM
Thanks... It worked... Problem with Cobalt backups are if the drive goes so does the backup so what good is that...

:D