Linux Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsOperating SystemsLinux Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old June 23rd, 2003, 12:02 PM
nindoja nindoja is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2003
Posts: 147 nindoja User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 18 h 21 m 53 sec
Reputation Power: 6
Making a .zip file on a linux server

Hello. Is it possible, through the command line, to make a .zip file from a certain folder???
Thanks.

Reply With Quote
  #2  
Old June 23rd, 2003, 08:18 PM
GNUbie's Avatar
GNUbie GNUbie is offline
Throws Rocks
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2002
Location: Cincinnati, Ohio
Posts: 392 GNUbie User rank is Corporal (100 - 500 Reputation Level)GNUbie User rank is Corporal (100 - 500 Reputation Level)GNUbie User rank is Corporal (100 - 500 Reputation Level)GNUbie User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 6 h 31 m 7 sec
Reputation Power: 8
Yes, use the zip command. For more info, run the command: man zip

Reply With Quote
  #3  
Old June 24th, 2003, 11:38 AM
nindoja nindoja is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2003
Posts: 147 nindoja User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 18 h 21 m 53 sec
Reputation Power: 6
Thanks, but how would I do that for a cron job???

Thanks, but how would I do that for a cron job???

Reply With Quote
  #4  
Old June 24th, 2003, 07:46 PM
GNUbie's Avatar
GNUbie GNUbie is offline
Throws Rocks
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2002
Location: Cincinnati, Ohio
Posts: 392 GNUbie User rank is Corporal (100 - 500 Reputation Level)GNUbie User rank is Corporal (100 - 500 Reputation Level)GNUbie User rank is Corporal (100 - 500 Reputation Level)GNUbie User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 6 h 31 m 7 sec
Reputation Power: 8
Add it to the crontab. For more info, run the command: man crontab

Reply With Quote
  #5  
Old June 24th, 2003, 09:00 PM
nindoja nindoja is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2003
Posts: 147 nindoja User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 18 h 21 m 53 sec
Reputation Power: 6
Would this work:
Code:
zip /home/nindoja/public_html/ > /home/nindoja/mysqlbackup/backup.zip

Reply With Quote
  #6  
Old June 28th, 2003, 07:48 AM
pep pep is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2003
Posts: 135 pep User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
why don't you try it?
try it!

Reply With Quote
  #7  
Old June 28th, 2003, 10:55 AM
nindoja nindoja is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2003
Posts: 147 nindoja User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 18 h 21 m 53 sec
Reputation Power: 6
Ok, that doesn't work. How would I have it zip this folder: /home/nindoja/public_html/ into this folder /home/nindoja/mysqlbackup/???

Reply With Quote
  #8  
Old June 28th, 2003, 05:39 PM
pep pep is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2003
Posts: 135 pep User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
ok as written above you should have read man zip
it says thatthe command is

zip archivename.zip filetoarchiv

to archive a directory you should type

zip -r archivename.zip dirtoarchive

this command works ...

then to add it to cron tab you type

crontab -e

and add
26 3 10 * * zip -r /home/nindoja/mysqlbackup/backup.zip /home/nindoja/public_html/

to execute the backup each 10th day of the at 3h26


nota benne: when you try a command that does not work you're not supposed to complain but to read the man file first, then to search the web for a tutorial and if only it is not enough ask for some help on a forum.

how come did you propose the command above:
Quote:
zip /home/nindoja/public_html/ > /home/nindoja/mysqlbackup/backup.zip
if you have seriously read the man file and tried it .

Reply With Quote
  #9  
Old June 28th, 2003, 06:38 PM
nindoja nindoja is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2003
Posts: 147 nindoja User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 18 h 21 m 53 sec
Reputation Power: 6
Thanks. The reason that I didn't read man zip is because I am hosted, and don't have access to the command line.

Reply With Quote
  #10  
Old June 28th, 2003, 07:51 PM
pep pep is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2003
Posts: 135 pep User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
how do you add a line to cron then?

Reply With Quote
  #11  
Old June 28th, 2003, 09:26 PM
nindoja nindoja is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2003
Posts: 147 nindoja User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 18 h 21 m 53 sec
Reputation Power: 6
I use CPanel 6.0

Reply With Quote
  #12  
Old June 29th, 2003, 09:59 AM
nindoja nindoja is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2003
Posts: 147 nindoja User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 18 h 21 m 53 sec
Reputation Power: 6
When I ran that on the commmand line, I got an e-mail from Cron, saying that the command wasn't found. Here is what I typed in the cron job:
Code:
zip -r /home/nindoja/mysqlbackup/backup.zip /home/nindoja/public_html/

Reply With Quote
  #13  
Old June 29th, 2003, 12:47 PM
pep pep is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2003
Posts: 135 pep User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
use cpanel cron utility with its advanced unix style
make sure that you're dir mysqlbackup already exists and that you hav the zip utility.
try this command
zip -r ~/mysqlbackup/backup.zip ~/public_html

and set the integers to what you want (* is for each)

Reply With Quote
  #14  
Old June 29th, 2003, 03:57 PM
nindoja nindoja is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2003
Posts: 147 nindoja User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 18 h 21 m 53 sec
Reputation Power: 6
What is the zip utility???

Reply With Quote
  #15  
Old June 30th, 2003, 10:41 AM
pep pep is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2003
Posts: 135 pep User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
ok I asked you if to ùmake sure that you have the zip package installed on your linux machine, and that you're allowed to use it.

Reply With Quote
Reply

Viewing: Dev Shed ForumsOperating SystemsLinux Help > Making a .zip file on a linux server


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support |