1
0
mirror of https://github.com/kellyjonbrazil/jc.git synced 2025-06-21 00:19:42 +02:00

doc update

This commit is contained in:
Kelly Brazil
2020-02-04 14:18:14 -08:00
parent 9a0cfe6dfa
commit 7c712a4133

View File

@ -13,27 +13,22 @@ Examples:
$ cat /etc/crontab | jc --crontab -p $ cat /etc/crontab | jc --crontab -p
{ {
"variables": [ "variables": [
{
"name": "MAILTO",
"value": "root"
},
{ {
"name": "PATH", "name": "PATH",
"value": "/sbin:/bin:/usr/sbin:/usr/bin" "value": "/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin"
}, },
{ {
"name": "SHELL", "name": "SHELL",
"value": "/bin/bash" "value": "/bin/sh"
} }
], ],
"schedule": [ "schedule": [
{ {
"minute": [ "minute": [
"5" "25"
], ],
"hour": [ "hour": [
"10-11", "6"
"22"
], ],
"day_of_month": [ "day_of_month": [
"*" "*"
@ -44,14 +39,15 @@ Examples:
"day_of_week": [ "day_of_week": [
"*" "*"
], ],
"command": "/var/www/devdaily.com/bin/mk-new-links.php" "user": "root",
"command": "test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.daily )"
}, },
{ {
"minute": [ "minute": [
"30" "47"
], ],
"hour": [ "hour": [
"4/2" "6"
], ],
"day_of_month": [ "day_of_month": [
"*" "*"
@ -60,72 +56,77 @@ Examples:
"*" "*"
], ],
"day_of_week": [ "day_of_week": [
"7"
],
"user": "root",
"command": "test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.weekly )"
},
{
"minute": [
"52"
],
"hour": [
"6"
],
"day_of_month": [
"1"
],
"month": [
"*" "*"
], ],
"command": "/var/www/devdaily.com/bin/create-all-backups.sh" "day_of_week": [
}, "*"
{ ],
"occurrence": "yearly", "user": "root",
"command": "/home/maverick/bin/annual-maintenance" "command": "test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.monthly )"
},
{
"occurrence": "reboot",
"command": "/home/cleanup"
},
{
"occurrence": "monthly",
"command": "/home/maverick/bin/tape-backup"
} }
] ]
} }
$ cat /etc/crontab | jc --crontab -p -r $ cat /etc/crontab | jc --crontab-u -p -r
{ {
"variables": [ "variables": [
{
"name": "MAILTO",
"value": "root"
},
{ {
"name": "PATH", "name": "PATH",
"value": "/sbin:/bin:/usr/sbin:/usr/bin" "value": "/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin"
}, },
{ {
"name": "SHELL", "name": "SHELL",
"value": "/bin/bash" "value": "/bin/sh"
} }
], ],
"schedule": [ "schedule": [
{ {
"minute": "5", "minute": "25",
"hour": "10-11,22", "hour": "6",
"day_of_month": "*", "day_of_month": "*",
"month": "*", "month": "*",
"day_of_week": "*", "day_of_week": "*",
"command": "/var/www/devdaily.com/bin/mk-new-links.php" "user": "root",
"command": "test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.daily )"
}, },
{ {
"minute": "30", "minute": "47",
"hour": "4/2", "hour": "6",
"day_of_month": "*", "day_of_month": "*",
"month": "*", "month": "*",
"day_of_week": "7",
"user": "root",
"command": "test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.weekly )"
},
{
"minute": "52",
"hour": "6",
"day_of_month": "1",
"month": "*",
"day_of_week": "*", "day_of_week": "*",
"command": "/var/www/devdaily.com/bin/create-all-backups.sh" "user": "root",
}, "command": "test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.monthly )"
{
"occurrence": "yearly",
"command": "/home/maverick/bin/annual-maintenance"
},
{
"occurrence": "reboot",
"command": "/home/cleanup"
},
{
"occurrence": "monthly",
"command": "/home/maverick/bin/tape-backup"
} }
] ]
} }
""" """
import jc.utils import jc.utils
import jc.parsers.universal import jc.parsers.universal
@ -159,8 +160,8 @@ def process(proc_data):
{ {
"variables": [ "variables": [
"name": string, "name": string,
"value": string "value": string
], ],
"schedule": [ "schedule": [
{ {
@ -181,6 +182,7 @@ def process(proc_data):
string string
], ],
"occurrence": string, "occurrence": string,
"user": string,
"command": string "command": string
} }
] ]