How to do crontab with Solaris?

Almighty1

Senior member
Oct 1, 2000
598
0
0
Does anyone know how to do the crontab job for Solaris on a x86 platform like to run a job on every reboot of the machine? In FreeBSD, it's just @reboot username command

 

Russ

Lifer
Oct 9, 1999
21,093
3
0
You want the easy way?:) Grab Webmin. It supports mucho OS's, including Solaris. You can remotely manage it too.

From their page:



<< The best supported systems at the moment are Solaris, Linux (Redhat in particular) and FreeBSD. >>



:D

Russ, NCNE
 

Almighty1

Senior member
Oct 1, 2000
598
0
0
Heh, webmin is cool but isn't there a way to do it with crontab itself? I think for Linux, the best is still Debian :) Okay, I've used SLS linux before FreeBSD existed since 386bsd was bad those days.... but FreeBSD have been solid in performance, stability, and reliability for the last 8 years =)

 

Poof

Diamond Member
Jul 27, 2000
4,305
0
0
Almighty1 - I can't speak for how Solaris would restart at boot but with linux, you can either add things in /etc/rc.d/init.d/<run level files> (where you can set services to stop/start at a certain runlevel during boot) OR an easier way is the fact that many of the distros have a rc.local (or similarly named fle) where you can execute commands at boot AFTER the aforementioned run level services have executed.

The linux crontab jobs generally run while the machine is up.
 

Russ

Lifer
Oct 9, 1999
21,093
3
0
Almighty1,

You can manage cron jobs and boot processes (as well as a billion other things) with Webmin. In other words, you don't have to know how to do it in Solaris, just install Webmin and access the appropriate module.

For example: On a Linux box, you'd just go in to System/Scheduled Cron Jobs to add/delete/edit/run any jobs. Same thing for Bootup and Shutdown processes. I would assume it's similar in Solaris.

The proggie would be particularly useful in your situation because it can be remotely accessed and used.

Now, I know you *nix geeks really like to do things the hard way, but I like better mousetraps myself.:)

Russ, NCNE
 

Poof

Diamond Member
Jul 27, 2000
4,305
0
0
LOL Russ!

I think Webmin was one of the first apps I found and installed about a year ago... Although I haven't used it much anymore (probably because I couldn't get it to configure Samba correctly for me... at least the version I had back then... :().
 

The_One

Senior member
Feb 23, 2000
391
0
0
crontab is for time specific jobs, it is indeed the RC<x>.d directories you are interested in, just put a script that runs the job in the relavant run level diretory called S<xx><JobName> where the xx = a higher number than anything else, so it runs last, but must be less than 100, and the JobName can be anything you like, S = start and K = kill, dont forget to make it executable (and to test it unless you have . in the path you will need to type ./S<xx><JobName> to run it)

Hope this helps if you dont get web thing to work.
 

nexus9

Senior member
Jan 8, 2000
535
0
0
setenv EDITOR vi
crontab -e

edit to your liking. Do a &quot;man crontab&quot; for detailed info.

However, it sounds like what you really want is a script that runs at boot time:

cd /etc/rc3.d
vi s90foobar (choose any name that starts with &quot;s&quot; and a number).

-Nexus9


&quot;We don't need no steenking webmin...&quot;
 

The_One

Senior member
Feb 23, 2000
391
0
0
nex: not forgetting to type csh first as the default shell under Solaris is Korn as opposed to 'C' shell (as setenv is a 'C' shell command)