LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
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, 10: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, 10:37 PM   #2
jailbait
Guru
 
Registered: Feb 2003
Location: Blue Ridge Mountain
Distribution: Debian Wheezy, Debian Jessie
Posts: 7,590

Rep: Reputation: 187Reputation: 187
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, 10: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


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 05:44 AM
show biggest files in tar archive? ahz10 Linux - Software 3 11-04-2005 04:48 PM
Apache problem with displaying compression/archive files. Akujin Linux - Networking 4 03-09-2005 03:18 AM
How to list the files in my tar.bz2 archive ??? merlin23 Linux - Newbie 13 12-14-2004 09:50 AM
What Are archive.zip files? kajensen Linux - General 1 09-21-2003 05:00 AM


All times are GMT -5. The time now is 07:37 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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration