Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices

Welcome to LinuxQuestions.org, a friendly and active Linux Community.

You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!

Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.

If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.

Having a problem logging in? Please visit this page to clear all LQ-related cookies.

Introduction to Linux - A Hands on Guide

This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.

I have a VPS with 10 GB disk space, and 8.5 GB is occupied by multiple files, that I want to transfer to my computer and then delete from the vps.
It takes a lot of time to download the files one at a time, and then rearranging them into the directory/subdirectory structure they originally had.
So I want to be able to make an archive of these files(all of them are within a single directory), without using any additional disk space. Like maybe simply convert the directory into an archive, or maybe archive a file then delete it, and so on.
Is that possible? compression does not matter that much to me.
Thanks in advance

why do you need to archive them to get them off the vps? Have you considered using something like rsync?

Code:

rsync -auzv -e ssh myvps:/path/to/files/to/archive .

The above command would be run on the target machine, "myvps" is the hostname or ip of your vps, and the directory structure of /path/to/files/to/archive on the vps would be synced to the directory "archive" in current working directory. The -z options means the data is compressed before transfer (and decompressed at the destination) and the "-e ssh" (which is probably default anyway) means the authentication etc is all done using ssh. Once you've got what you want from the vps you can delete the originals.

So I want to be able to make an archive of these files(all of them are within a single directory), without using any additional disk space. Like maybe simply convert the directory into an archive, or maybe archive a file then delete it, and so on. Is that possible? compression does not matter that much to me.

While you can use tar w/o compression and use the --delete-files switch this does not make sense as the archive file will take up as much space as the original. Besides the smaller the archive the less D/L time it will take. So compression does matter. What you could do is try and find out which files benefit from compression the most (plain ASCII files) and see what you gain from compressing those first. One other thing that may come in handy is a tmpfs scratch disk, tho at 8G you'll still better archive large files separately to avoid it halting on lack of scratch space.

Quote:

Originally Posted by enkrypted

It takes a lot of time to download the files one at a time, and then rearranging them into the directory/subdirectory structure they originally had.

...but rsync will accomplish all of that. Just start it and fetch some $beverage ...

I have a relatively slow internet connection at home. My maximum download speed is ~400 kbps.
Also, is rsync possible on Windows? And do I need to install it on the vps as well?
I want to convert it into an archive because that way I would be able to transfer it in one go. I like to use IDM, as that gives me the highest speed.
Also, these files are media files. Videos to be specific.
Thanks for the help. I'll try both the methods.

rsync is definitely usable on slow networks, available on windows too. it should not be installed at all, because it consists of 2 or 3 files altogether and you can put them anywhere you want (but of course you can install it).
rsync is able to transfer only differences.