LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Fedora
User Name
Password
Fedora This forum is for the discussion of the Fedora Project.

Notices


Reply
  Search this Thread
Old 02-28-2009, 08:11 AM   #1
Jose Rivas
Member
 
Registered: Jul 2006
Posts: 56

Rep: Reputation: 15
Smile 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.
 
Old 02-28-2009, 10:20 AM   #2
colucix
LQ Guru
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,509

Rep: Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983
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.
 
Old 02-28-2009, 10:38 AM   #3
David the H.
Bash Guru
 
Registered: Jun 2004
Location: Osaka, Japan
Distribution: Arch + Xfce
Posts: 6,852

Rep: Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037
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.
 
Old 03-02-2009, 09:48 AM   #4
Jose Rivas
Member
 
Registered: Jul 2006
Posts: 56

Original Poster
Rep: Reputation: 15
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.
 
Old 03-02-2009, 10:29 AM   #5
Jose Rivas
Member
 
Registered: Jul 2006
Posts: 56

Original Poster
Rep: Reputation: 15
Now is working fine

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

Usign Kalarm to programing task.
 
  


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
Make a schedul job Jose Rivas Fedora 2 08-09-2006 01:08 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Fedora

All times are GMT -5. The time now is 07:26 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