Simulate CRON

Matthew Seaman m.seaman at infracaninophile.co.uk
Mon Jun 14 12:13:45 UTC 2010


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

On 14/06/2010 12:55:34, Robert Huff wrote:
> 
> Carmel writes:
> 
>>  > > I saw a posting here months ago regarding a way to simulate running
>>  > > a script under CRON. I wrote it down and now cannot find it.
>>  > > Googling has not proved very useful either. I just cannot remember
>>  > > the program name.
>>
>>  > Are you looking for a cron syntax check? If yes, then this site
>>  > should be of some help:
>>  
>>  No, sorry. There was a command or program, I forgot which, that
>>  would allow a user to run a program under another environment,
>>  similar to the environment that a script under CRON would be
>>  running under.
> 
> 	Are you possibly talking about a jail?

Try:

   env -i USER=$USER HOME=$HOME LOGNAME=$LOGNAME \
     PATH=/usr/bin:/bin SHELL=/bin/sh PWD=$HOME your-script-name

	Cheers,

	Matthew

- -- 
Dr Matthew J Seaman MA, D.Phil.                   7 Priory Courtyard
                                                  Flat 3
PGP: http://www.infracaninophile.co.uk/pgpkey     Ramsgate
JID: matthew at infracaninophile.co.uk               Kent, CT11 9PW
-----BEGIN PGP SIGNATURE-----
Version: GnuPG/MacGPG2 v2.0.14 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkwWHPQACgkQ8Mjk52CukIx5fQCaAlvxOIEvdG96J1+lSB0UCQlX
NqsAnjFA4gG6eJtPiHlIBcfdRzjxaSAB
=AwPN
-----END PGP SIGNATURE-----


More information about the freebsd-questions mailing list