Question : Problem: Creating a zip or rar file on a dedicated server

I would like to know if it possible to make a zip or rar file on a dedicated server that I have?

I have transfered some folders that contain images from one to server to another and I would like to be able to make a zip or rar of the folder so the contents are easier to download.

Instead of having to download the folder make a zip or rar and the re-upload it again to the server.

The OS on the server is Plesk 8.4 and I have root access also.

I am not very good with ssh commands but can follow instructions to run commands.

If anyone know if it is possible I would appreciate it.

Many thanks.

Answer : Problem: Creating a zip or rar file on a dedicated server

It is very common to use tar (and gzip together) to move a folder of files around (as one convenient archive), on linux machines. Although, if you are running windows anywhere you want to untar/decompress the folder, you must have a tar compatible archive utility installed (7zip, for example -- http://www.7-zip.org/).

# move to the parent dir, this will
# make it easier when you unpack
cd /var/www/vhosts/mydomain.com/httpdocs/downloads/ezdub/MPL2

# use tar to create a compressed archive
tar zcvf tony.tgz tony/

# scp the file to the desired
# destination and unpack
tar zxvf tony.tgz
# which will create a tony folder
# with the contents of the archive
# in the current directory

You can also just use the zip or rar commands if they are installed on the server.

# pack
zip -r tony.zip tony/
rar a tony.rar tony

# unpack
unzip tony.zip
unrar x tony.rar

By the way, Plesk is not an operating system. It is a server management application that provides a web control panel. It is capable of running on many different operating systems, including Linux and Windows. http://en.wikipedia.org/wiki/Plesk

Random Solutions  
 
programming4us programming4us