Python / Odoo Developer

Welcome!

This community is for professionals and enthusiasts of our products and services. Share and discuss the best content and new marketing ideas, build your professional profile and become a better marketer together.

0

Linux Crontab Chronojob

Avatar
Administrator

Open 


*     *     *   *    *        command to be executed
-     -     -   -    -
|     |     |   |    |
|     |     |   |    +----- day of week (0 - 6) (Sunday=0)
|     |     |   +------- month (1 - 12)
|     |     +--------- day of        month (1 - 31)
|     +----------- hour (0 - 23)
+------------- min (0 - 59)


To edit crontab

  • crontab -e

To add a command:

  •  0 0 * * * command_to_execute

   

To view Root’s Cron Jobs

crontab -l

View a User’s Cron Jobs

crontab -u username -lExample with user testuser:

crontab -u testuser -l

View Daily Cron Jobs

First view all the daily cron jobs:

ls -la /etc/cron.daily/

Then view a specific daily cron job:

less /etc/cron.daily/filename

Example with filename logrotate:

less /etc/cron.daily/logrotate

View Hourly Cron Jobs

First view all the hourly cron jobs:

ls -la /etc/cron.hourly/

Then view a specific hourly cron job:

less /etc/cron.hourly/filename

Example with filename 0anacron:

less /etc/cron.hourly/0anacron

View Weekly Cron Jobs

First view all the weekly cron jobs:

ls -la /etc/cron.weekly/

Then view a specific weekly cron job:

less /etc/cron.weekly/filename

Example with filename weeklyexample:

less /etc/cron.weekly/weeklyexample

View Monthly Cron Jobs

First view all the monthly cron jobs:

ls -la /etc/cron.monthly/

Then view a specific monthly cron job:

less /etc/cron.monthly/filename

Example with filename readahead-monthly.cron:

less /etc/cron.monthly/readahead-monthly.cron

View /etc/crontab

less /etc/crontab

Avatar
Abbandona