LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Fedora (https://www.linuxquestions.org/questions/fedora-35/)
-   -   Do autozip schedul (https://www.linuxquestions.org/questions/fedora-35/do-autozip-schedul-708190/)

Jose Rivas 02-28-2009 08:11 AM

Do autozip schedul
 
In a /home subfolder there are some files shared with samba. I want to do a zip of these files and copy the new zip file in other /home folder location, same machine.
I'm sure this is easy job for scripts, but I dont know how to do it.
Plz help me.

colucix 02-28-2009 10:20 AM

Yes. It's an easy task for a cron job, but you have to give more details. For example, do you want to zip (or gzip) all the files in that directory or do you need to select some of them based on some criteria (file name, last modification time and so on)? What have you tried so far?

When you have written the script, make it executable and edit the crontab to schedule the job at some specific time of the day or at some day of the month or at some day of the week. Look at
Code:

man 5 crontab
for details about the crontab format. Due to some limitations of the cron environment, it is a good practice to use absolute path for all the commands within the script and to change directory whenever you have to do some actions from a specific location.

David the H. 02-28-2009 10:38 AM

LinuxCommand.org provides an excellent beginner-level introduction to shell scripting. A few hours with it should give you the basic techniques you need to create a script like this. Give it a try and we'll help you through the rough spots. :)

After you get the script working, we can worry about setting up the cronjob, as colucix mentioned.

Jose Rivas 03-02-2009 09:48 AM

All files on /home/luis/ must be zipped into a zipfile.
I want to do in Linux something like this example for PkZip for DOS

pkzip25 -add /home/backup/auto.zip *.*
And then save the commando like a job cron.
Must be zip format because another user called "backup" will load the zip file across samba shares with Windows.

Jose Rivas 03-02-2009 10:29 AM

Now is working fine

zip -r /home/backup/auto.zip /home/luis/*

Usign Kalarm to programing task.


All times are GMT -5. The time now is 09:34 PM.