|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
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. |
|
#2
|
||||
|
||||
|
Yes, use the zip command. For more info, run the command: man zip
|
|
#3
|
|||
|
|||
|
Thanks, but how would I do that for a cron job???
Thanks, but how would I do that for a cron job???
|
|
#4
|
||||
|
||||
|
Add it to the crontab. For more info, run the command: man crontab
|
|
#5
|
|||
|
|||
|
Would this work:
Code:
zip /home/nindoja/public_html/ > /home/nindoja/mysqlbackup/backup.zip |
|
#6
|
|||
|
|||
|
why don't you try it?
try it! |
|
#7
|
|||
|
|||
|
Ok, that doesn't work. How would I have it zip this folder: /home/nindoja/public_html/ into this folder /home/nindoja/mysqlbackup/???
|
|
#8
|
|||
|
|||
|
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:
|
|
#9
|
|||
|
|||
|
Thanks. The reason that I didn't read man zip is because I am hosted, and don't have access to the command line.
|
|
#10
|
|||
|
|||
|
how do you add a line to cron then?
|
|
#11
|
|||
|
|||
|
I use CPanel 6.0
|
|
#12
|
|||
|
|||
|
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/ |
|
#13
|
|||
|
|||
|
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) |
|
#14
|
|||
|
|||
|
What is the zip utility???
|
|
#15
|
|||
|
|||
|
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.
|
![]() |
| Viewing: Dev Shed Forums > Operating Systems > Linux Help > Making a .zip file on a linux server |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|