commands – cron import
Command to import one or more Posix crontab files as BeyondCron jobs.
Usage
cron import [raw] [enable] root host (file|directory) [timezone]
where
raw | do not attempt to convert schedules to repeat/daily schedules. Default = attempt to convert schedules. |
enable | resultant job. Default = jobs are disabled. |
root | group in which to create the imported jobs. |
host | to execute jobs on. |
file | name of crontab file to import. The name of the file, must be named either username, or username.suffix where username is the name of the user logged into BeyondCron, and suffix is user defined. |
directory | containing one or more user crontab files to import. |
timezone | to apply to job schedules. Default = timezone of shell running this command. In order to import crontabs for all users you must belong to the admin role. |
write on root
Examples
Import a single users crontab file, and enable the resultant jobs
BeyondCron % cron import enable /demo/cron server1 /var/opt/demo/data/demo.crontab
/demo/cron/distribute created /demo/cron/generate created /demo/cron/...
BeyondCron % job list /demo/cron
Job Type Mode Description ---------------------------------------- ------- ------- ----------------------------- /demo/cron/enriched/distribute Command Enabled Distribute daily sales report... /demo/cron/enriched/generate Command Enabled Generate daily sales report /demo/cron/enriched/normalise-sales-data Command Enabled Normalise sales figures into ... ...
if a cron entry is immediately preceded by a comment, then the comment will be used as the
resultant job description. For example:
# Normalise sales figures into a common format 10 7 * * * normalise-sales-data
if a cron entry is immediately preceded by a comment, which starts with a pair of square brackets, then the first word comment will be used as the job name, and any other words as success conditions. Anything after the brackets will be used as the job description. For example:
# [ distribute generate ] Distribute daily sales report on weekdays 40 7 * * 0-4 . yesterday -q '%d-%m-%Y'; mutt -s "Revenue report for ${YESTERDAY}" ...
if the environment variable BEYONDCRON_CALENDAR
is defined within the crontab file, then it will be used as the calendar value for any succeeding entries jobs. All other environment variables will be added as job properties.
BEYONDCRON_CALENDAR=/demo/sales/weekdays # [ distribute : generate ] Distribute daily sales report on weekdays 40 7 * * 0-4 . yesterday -q '%d-%m-%Y'; mutt -s "Revenue report for ${YESTERDAY}" ...
See also
- job conditions
- job description
- job properties
- schedule cron
- schedule daily
- schedule repeat
- Timezones