crontab Tools
crontabApplicationUpdate
Application-specific crontab management
Usage
crontabApplicationUpdate [ --env-file environment ] [ --show ] [ --user user ] [ --mapper envMapper ] applicationPath
Keep crontab synced with files and environment files in an application folder structure.
Structure is:
appPath/application1/.envappPath/application1/.env.localappPath/application1/etc/user.crontab
Search for user.crontab in applicationPath and when found, assign APPLICATION_NAME to the top-level directory name
and APPLICATION_PATH to the top-level directory path and then map the file using the environment files given.
Any .env or .env.local files found at $applicationPath/ will be included for each file generation.
Feasibly for each file, the following environment files are loaded:
rootEnvapplicationPath/applicationName/.envapplicationPath/applicationName/.env.local
Any files not found are skipped. Note that environment values are not carried between applications.
Arguments
--env-file environmentFile- Top-level environment file to pass variables into the usercrontabtemplate--show- Show the crontab instead of installing it--user user- Scan for crontab files in the formuser.crontaband then install as this user. If not specified, uses current user name.--mapper envMapper- Optional. Binary. The binary use to map environment values to the file. (UsesmapEnvironmentby default)
Examples
crontabApplicationUpdate --env-file /etc/myCoolApp.conf --user www-data /var/www/applications
crontabApplicationUpdate /etc/myCoolApp.conf /var/www/applications www-data /usr/local/bin/map.sh
Return codes
0- Success1- Environment error2- Argument error