LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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!

Notices


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

Rep: Reputation: 0
Moving files into an archive


Hi,

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
jailbait
LQ Guru
 
Registered: Feb 2003
Location: Virginia, USA
Distribution: Debian 12
Posts: 8,344

Rep: Reputation: 551Reputation: 551Reputation: 551Reputation: 551Reputation: 551Reputation: 551
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
gkep
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.
 
  


Reply



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 archive.zip files? kajensen Linux - General 1 09-21-2003 04:00 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 09:48 AM.

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