LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices

Reply
 
LinkBack Search this Thread
Old 06-20-2007, 11:21 AM   #1
philipo
LQ Newbie
 
Registered: Jun 2007
Posts: 8

Rep: Reputation: 0
Schedule a script to run


Hello everyone

In slackware, how do I configure a script to run 2 times a day at a specified time? I am planning to make a back-ups of the files... And I need to know how I can schedule the server to do it 2 times a day.


Thanks.
Philip
 
Old 06-20-2007, 11:33 AM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 39,856

Rep: Reputation: 1121Reputation: 1121Reputation: 1121Reputation: 1121Reputation: 1121Reputation: 1121Reputation: 1121Reputation: 1121Reputation: 1121
that'd be cron. check the cron and crontab manpages for details.
 
Old 06-20-2007, 11:39 AM   #3
theYinYeti
Senior Member
 
Registered: Jul 2004
Location: Nantes (France)
Distribution: Arch Linux
Posts: 1,897

Rep: Reputation: 61
Use cron if your machine is up all the time, else anacron.

Yves.
 
Old 06-22-2007, 05:10 PM   #4
onebuck
Moderator
 
Registered: Jan 2005
Location: Midwest USA, Central Illinois
Distribution: SlackwareŽ
Posts: 9,367
Blog Entries: 1

Rep: Reputation: 763Reputation: 763Reputation: 763Reputation: 763Reputation: 763Reputation: 763Reputation: 763
Quote:
Originally Posted by philipo
Hello everyone

In slackware, how do I configure a script to run 2 times a day at a specified time? I am planning to make a back-ups of the files... And I need to know how I can schedule the server to do it 2 times a day.


Thanks.
Philip
Hi,

Look at /etc/cron.daily, /etc/cron.hourly, /etc/cron.monthly, or /etc/cron.weekly depending on your needs. You could setup a cron job to your specifics. Do a 'man crontab' to understand the cron jobs.

Here is an example for time on one of my servers;
Code:
amos:/etc/cron.hourly# cat /etc/cron.hourly/time_amos |less

#!/bin/sh
#10-09-06 08:30 gws
#update time on amos via time.mtco.com
#
#11-06-06 gws change to pool

/usr/sbin/ntpdate -v 0.us.pool.ntp.org ntp-1.mcs.anl.gov ntp-2.mcs.anl.gov &&hwclock --systohc
This uses the /etc/cron.hourly directory. This script is run on the hour. Note that the file must be executable;
Code:
ls -al
-rwxr-xr-x   1 root root  243 2007-06-22 16:53 time_amos*
If you do a search on the Slackware forum you will get a lot of threads relative to your needs for cron.
 
  


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
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
how to run a schedule in every 2 mins!! rahulrawat Red Hat 7 12-24-2005 06:58 PM
Schedule a Script to Run nutthick Linux - Newbie 8 02-02-2005 12:37 PM
Schedule a script every three hours dkochan Linux - General 1 03-07-2004 10:18 AM
schedule 'e2fsck' to run on startup, possible? BxBoy Linux - General 1 02-18-2004 12:15 PM
how do i schedule events to run daily. ThaddNZ2003 Linux - General 2 03-10-2003 10:59 AM


All times are GMT -5. The time now is 06:44 PM.

Main Menu
 
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
Open Source Consulting | Domain Registration