Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 07-27-2003, 09:26 PM   #1
LQ Newbie
Registered: Jul 2003
Posts: 2

Rep: Reputation: 0
Moving files into an archive


Getting my hands dirty with the Linux command line but have hit a bit of a wall.

My dilemma is that my hosting server is fairly limited with disk space and I keep filling it up with a PHP script that grabs content.

What I am trying to do is *move* a few hundred files in a subdirectory into one compressed file.

Is there any way of doing this so that it actually deletes each file immediately after it is added to the archive? Otherwise I go over my disk quota during the process and can't write the archive file to disk.

Thanks very much for your time.
Old 07-27-2003, 09:37 PM   #2
LQ Guru
Registered: Feb 2003
Location: Blue Ridge Mountain
Distribution: Debian Wheezy, Debian Jessie
Posts: 7,661

Rep: Reputation: 229Reputation: 229Reputation: 229
You might be able to build a loop in a script to do that.
The first instruction selects a file name and passes the name to tar.
tar appends the file to the archive.
the third instruction deletes the file
loop to next name.
Old 07-27-2003, 09:42 PM   #3
LQ Newbie
Registered: Jul 2003
Posts: 2

Original Poster
Rep: Reputation: 0
Good suggestion

Sounds like a good idea... I might even be able to do it with PHP even!

Thanks for the idea.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Recovering files from corrupt TAR archive... johnwyles Linux - Software 8 04-17-2006 04:44 AM
show biggest files in tar archive? ahz10 Linux - Software 3 11-04-2005 03:48 PM
Apache problem with displaying compression/archive files. Akujin Linux - Networking 4 03-09-2005 02:18 AM
How to list the files in my tar.bz2 archive ??? merlin23 Linux - Newbie 13 12-14-2004 08:50 AM
What Are files? kajensen Linux - General 1 09-21-2003 04:00 AM

All times are GMT -5. The time now is 07:29 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration