Jump to content

Adding a cronjob

- - - - -

This topic has been archived. This means that you cannot reply to this topic.
4 replies to this topic

#1
Guest_ptt3_*

Guest_ptt3_*
  • Guests
How do I add a cronjob to Solaris?

#2
Guest_Jordan_*

Guest_Jordan_*
  • Guests
The same way as in Linux

crontab -e

You will be entered into a file with your default editor.

#3
MHJ

MHJ

    Newbie

  • Members
  • PipPip
  • 29 posts
I am not familiar with what this refers to. What exactly is a crontab?

#4
Jame

Jame

    Learning Programmer

  • Members
  • PipPipPip
  • 32 posts
Cron is a scheduler like Windows Scheduler. It will execute events at the given times you input.

#5
LissaValerian

LissaValerian

    Learning Programmer

  • Members
  • PipPipPip
  • 53 posts
Here is another way to edit the crontab file (not that theres anything wrong with the previous way!)

I like to write my crontabs out to a file, make a backup, edit the file, then write it back to the cron. I'm always careful of using crontab -e because if you do ^d in the middle of it, you wipe out the entire crontab. Yikes! And I've done that before.

So this is what I do:

crontab -l > crontab.username
# make a backup of the crontab
cp crontab.username crontab.username.MMDDYY##

vi crontab.username
# make my crontab edits

crontab crontab.username.out

# reads it back into the crontab.

Call that an abundance of caution. :-) Believe me, I've hosed my crontab on more than one occasion. And when you have crontabs that are like 3 pages long, that is NO fun.

backups are good. :-)