Welcome to WebmasterWorld Guest from 54.225.58.238

Forum Moderators: coopster & jatar k & phranque

Message Too Old, No Replies

Shell Script to Write Cron

     
6:54 pm on Feb 14, 2001 (gmt 0)

Preferred Member

10+ Year Member

joined:Nov 25, 2000
posts:541
votes: 0


I was wondering if it is possible to use a shell script to set up a few crontab's. I only know the most basic telnet procedures.

I want to set up weblog to run everyday in folder 'X'. Then once a week I would like a cron job to wipe out folder 'X' so the weblog files dont get too big.

7:43 pm on Feb 15, 2001 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:July 6, 2000
posts:904
votes: 0


I'm not quite sure what you mean. Sure, you can put a crontab command in a shell script - you can put any valid command you like in one - but I'm not sure if that's what you're asking.

There's some info on crontab here [rt.com] and here [rt.com].

7:47 pm on Feb 15, 2001 (gmt 0)

Senior Member

WebmasterWorld Senior Member littleman is a WebmasterWorld Top Contributor of All Time 10+ Year Member

joined:June 17, 2000
posts:2924
votes: 0


Air gives a walk through here [webmasterworld.com].
7:47 pm on Feb 15, 2001 (gmt 0)

Preferred Member

10+ Year Member

joined:Nov 25, 2000
posts:541
votes: 0


Thanks for your response SK.

I use the same scripts in all the sites I do so I want to be able to install all the stuff from a single shell script.

I want Weblog to run everyday at 12 and also once a week I want the folder that contains the weblog reports to be wiped out so it starts fresh again

8:02 pm on Feb 15, 2001 (gmt 0)

Preferred Member

10+ Year Member

joined:Nov 25, 2000
posts:541
votes: 0


To really clarify I want to SET-UP a cron from a shell script.
11:51 pm on Feb 19, 2001 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:July 6, 2000
posts:904
votes: 0


BH,

Once you've got a script that does whatever job you want scheduling, whether it be to delete a folder, run a program, whatever, just create your 'schedule' file as shown in Air's walk-through and put the crontab command in a script ie

#!/bin/bash
crontab schedule