Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

The "hcron - conv" program converts, in both directions, between crontab and hcron. See the hcron-conv man page for more.

From cron to hcron

  • for For each command and the preceding comments of the command of a crontab file are written to individual event files starting a name "0".
  • variables Variables and percent sign handling are ignored.
  • the The hostname parameter of of "hcron - conv is " is required in order to fill in the hcron host field.
  • optionallyOptionally, an email address can be provided using the --mail option in order to fill in the hcron notify_email field.

Example:

Code Block
crontab -l > crontab.copy
mkdir crontab.conv
hcron- conv --to-events hcron-server crontab.copy crontab-conv

The results are in crontabin crontab-conv/ .

In many cases, the conversion from crontab to hcron is lossless.

From hcron to cron

  • each Each event file in a specified directory is used to generate a single crontab entry.
  • if If the hcron host field is not empty, the command for the new crontab entry is prepended with ssh <host>.
  • variables Variables and comments are ignored.
  • optionallyOptionally, a remote shell other than ssh can be specified using the --remoteShell option.

Example:

Code Block
hcron- conv --to-crontab crontab.from_hcron hcron_dir

The results are in the crontabthe crontab.from_hcron filehcron  file.

If variables are used, conversion from hcron to crontab may not produce useful results or will require a bit of massaging.