Re: Automate a command


Subject: Re: Automate a command
From: Fielder George Dowding (fgdowding@iceworm-enterprises.net )
Date: Thu Jun 12 2003 - 01:31:07 AKDT


On Wed, Jun 11, 2003 at 12:23:43PM -0800, Greg Madden wrote:
>
> The following command + options creates a Debian mirror. I run it
> manually when I want to update my mirror. What I would like to do is
> make it so it runs automatically a couple of times a week. I don't know
> aything about scripts or cron jobs so a sequence of events and the
> terminology involved would help point me to research the correct docs.
>
> # 'debmirror -a i386,powerpc -h ftp-mirror.internap.com -r /pub/debian
> --ignore=non-US/ -d woody -d testing -d unstable /mnt/pub/mirror/debian
> -p --getcontents'
>
> This is all one line separated by blank spaces.
>
> TIA
>
> Greg Madden
> Precision Air Balance, Inc.
> Phone: 907-276-0461
> email: pabi@gci.net

Greetings Greg,

You are running Debian I assume. You should have the utility "crontab"
which you can use to set up a twice weekly cron job. The key is in
  man 5 crontab
If you just do a man crontab you will get crontab(1) which is just the
cli interface. It doesn't tell anything about how a stanza should be
formed whereas crontab(5) does (and with examples).

So, log in as you would for running your one line script and type:

  crontab -e
  7 15 * * 2,5 `debmirror -a ...

Be sure to put a newline at the end of the stanza. Warnings are in the
man pages: cron(8), crontab(1), and crontab(5).

The utility uses vi for its editor, so I left out the vi(m) commands to
insert, change to command mode, save and quit.

Well, I thought it was relatively straight forward. =:-)}}

-- 
Fielder George Dowding, Chief Iceworm        .-.   Debian/GNU Linux
dba Iceworm Enterprises, Anchorage, Alaska   /v\   "Woody" v3.0r1
Since 1976 - Over 25 Years of Service.      // \\  User Number 269482
                                           /(   )\
                                            ^^-^^

--------- To unsubscribe, send email to <aklug-request@aklug.org> with 'unsubscribe' in the message body.



This archive was generated by hypermail 2a23 : Thu Jun 12 2003 - 01:28:52 AKDT