[aklug] Re: (ana)cron & Linux Counter update script

From: Jim Gribbin <jimgribbin@gmail.com>
Date: Sun Oct 31 2010 - 17:07:24 AKDT

I was going to, but all the other files start with:

'#!/bin/sh' or '#!/bin/bash'

which believe means it's commented out. I'm guessing it was put there for form.

I did run chmod +x on it, just in case. It did not seem to need it to run from a command line.

Jim G

----- Original Message -----
From: "David J. Weller-Fahy" <dave-lists-aklug@weller-fahy.com>
To: aklug@aklug.org
Sent: Sunday, October 31, 2010 9:01:03 AM
Subject: [aklug] Re: (ana)cron & Linux Counter update script

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

* Jim Gribbin <jimgribbin@gmail.com> [2010-10-31 03:42 -0500]:
> I put a 2 line scrip in /etc/cron-weekly that consists of:
>
> #scrip to update this box on the linux counter project site weekly
> sudo -Hu jimg /home/jimg/.linuxcounter/machine-update -m
>
> at least it seems to work from the command line.
>
> Not have really done any scripts from scratch, do I need the '#!/bin/bash' stuff?

I would run `which sh`, which on my system results in /bin/sh, then
include '#!/bin/sh' as the first line of the file.

Check with the documentation for your cron/anacron system, though, and
see whether it's necessary on yours... if your cron system always runs
the scripts with a particular shell, and you want to use that shell,
then you don't have to specify.

- --
dave [ please don't CC me ]
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (Darwin)

iEYEARECAAYFAkzNoM8ACgkQzahokXOb2UxSywCfUFEL0FZUNM7dXwasEgvklhxX
fakAn07x14Ma6TCWfC3eRlQ4Lr0VEjvD
=pAaN
-----END PGP SIGNATURE-----
---------
To unsubscribe, send email to <aklug-request@aklug.org>
with 'unsubscribe' in the message body.

---------
To unsubscribe, send email to <aklug-request@aklug.org>
with 'unsubscribe' in the message body.
Received on Sun Oct 31 17:07:36 2010

This archive was generated by hypermail 2.1.8 : Sun Oct 31 2010 - 17:07:36 AKDT