bc-cli – cron import

Command to import one or more Posix crontab files as BeyondCron jobs.

Usage

cron import [raw] [enable] 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.
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 /crontabs/host

Examples

Import a single users crontab file

BeyondCron % cron import server1 /tmp/user1.crontab

Job /crontabs/server1/user1.1 created Job /crontabs/server1/user1.2 created Job /crontabs/server1/user1... created

BeyondCron % job list /crontabs

Job Type Mode Description -------------------------- ------- -------- ---------------------------------------- /crontabs/server1/jsmith.1 Command Disabled Imported cron job - Hard 3 minute repeat /crontabs/server1/jsmith.2 Command Disabled Imported cron job - Easy 3 minute repeat ...

if a cron entry is immediately preceded by a comment, then the comment will be included in the
resultant job description. For example:

... # Hard 3 minute repeat 1,4,7,10,13,16,19,22,25,28,31,34,37,40,43,46,49,52,55,58 * * * * /bin/echo are we there yet\?   # Easy 3 minute repeat 1/3 * * * * /bin/echo YES! ...

Import a single users crontab file within a specific timezone

BeyondCron % cron import server1 /tmp/jsmith.crontab Japan

Job /crontabs/server1/jsmith.1 created Job /crontabs/server1/jsmith.2 created Job /crontabs/server1/...

Import a servers crontab files, and enable all of the resultant jobs

BeyondCron % cron import enable server1 /var/spool/cron

Job /crontabs/server1/jsmith.1 created Job /crontabs/server1/jsmith.2 created Job /crontabs/server1/... ... Job /crontabs/server1/root.1 created Job /crontabs/server1/...

BeyondCron % job list server1

Job Type Mode Description -------------------------- ------- ------- ---------------------------------------- /crontabs/server1/jsmith.1 Command Enabled Imported cron job - Hard 3 minute repeat /crontabs/server1/jsmith.2 Command Enabled Imported cron job - Easy 3 minute repeat /crontabs/server1/... ... /crontabs/server1/root.1 Command Enabled Imported cron job - Weekly reboot /crontabs/server1/...

See also

Reference