Update Makefile
This commit is contained in:
parent
b9f5fe108b
commit
e6717a64a2
9
Makefile
9
Makefile
@ -1,17 +1,18 @@
|
|||||||
SHELL=/bin/bash
|
SHELL=/bin/bash
|
||||||
|
|
||||||
|
# The cron job you want to add
|
||||||
|
NEW_CRON="0 3 * * * $(shell pwd)/main.sh"
|
||||||
|
|
||||||
run-script:
|
run-script:
|
||||||
# run the main script
|
# run the main script
|
||||||
main.sh
|
main.sh
|
||||||
|
|
||||||
install:
|
install:
|
||||||
# Add entry in crontab
|
# Add entry in crontab
|
||||||
# The cron job you want to add
|
|
||||||
NEW_CRON="0 3 * * * $(shell pwd)/main.sh"
|
|
||||||
# Check if it already exists (to avoid duplicates)
|
# Check if it already exists (to avoid duplicates)
|
||||||
( crontab -l 2>/dev/null | grep -F "$NEW_CRON" ) && echo "Cron already exists." && exit 0
|
( crontab -l 2>/dev/null | grep -F "$(NEW_CRON)" ) && echo "Cron already exists." && exit 0
|
||||||
# Add the new cron safely
|
# Add the new cron safely
|
||||||
( crontab -l 2>/dev/null; echo "$NEW_CRON" ) | crontab -
|
( crontab -l 2>/dev/null; echo "$(NEW_CRON)" ) | crontab -
|
||||||
|
|
||||||
requirements:
|
requirements:
|
||||||
# Add the necessary packages
|
# Add the necessary packages
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user