HP-UX UNIX: Start / Stop and Configure Cron Services
HP-UX UNIX: Start / Stop and Configure Cron Services
Q. I need to run a backup and other stuff everyday. How do I check and start cron service under HP-UX UNIX operating system? How do I write cron jobs? A. Cron service is required to run jobs and tasks such as backup. You must login as the root to run following commands. Each user that is using the cron service must have a cron configuration file in the /var/spool/cron/crontab directory. Also users are permitted if their name appeared in /var/adm/cron/cron.allow file
Set control variable to 1 to enable cron : CRON=1 Set control variable to 0 to disable : CRON=0 Close and save the file. To start or stop cron you can type the following command:
# /sbin/init.d/cron start <-- start cron # /sbin/init.d/cron stop <-- stop cron
List your cron file: Backup all your cron jobs: Remove ALL cron job:
# crontab -r # crontab -l > ~/backup.cron.jobs
Run foo job very weekday (MON-Fri) at 6am, enter: For more information refer to cron and crontab man pages.