fixing crontab again phew
All checks were successful
Check scripts syntax / check-scripts-syntax (push) Successful in 35s
All checks were successful
Check scripts syntax / check-scripts-syntax (push) Successful in 35s
This commit is contained in:
parent
97010d71ff
commit
b54222eb23
@ -146,19 +146,20 @@ echo -e "${GREY}[i] Setting up crontab..."
|
|||||||
# Add crontabs
|
# Add crontabs
|
||||||
for FILE in "${FILES[@]}"; do
|
for FILE in "${FILES[@]}"; do
|
||||||
if crontab -l 2>/dev/null | grep -q $FILE; then
|
if crontab -l 2>/dev/null | grep -q $FILE; then
|
||||||
echo -e "${LIGHT_BLUE}[i] [$FILE] Crontab already exists. Skipping.${NC}"
|
echo -e "${LIGHT_BLUE}[i] [$FILE] Crontab already exists. Removing...${NC}"
|
||||||
else
|
crontab -l | grep -v $FILE | crontab -
|
||||||
|
fi
|
||||||
echo -e "${LIGHT_BLUE}[i] [$FILE] Adding crontab...${NC}"
|
echo -e "${LIGHT_BLUE}[i] [$FILE] Adding crontab...${NC}"
|
||||||
|
|
||||||
if [ "$FILE" == "clean.sh" ]; then
|
if [ "$FILE" == "clean.sh" ]; then
|
||||||
(crontab -l 2>/dev/null; echo "0 0 * * * ${CURRENT_WORKDIR}/$FILE > /dev/null") | crontab -
|
(crontab -l 2>/dev/null; echo "0 0 * * * ${CURRENT_WORKDIR}/$FILE > /tmp/clean.log") | crontab -
|
||||||
elif [ "$FILE" == "backup.sh" ]; then
|
elif [ "$FILE" == "backup.sh" ]; then
|
||||||
(crontab -l 2>/dev/null; echo "0 0 * * * ${CURRENT_WORKDIR}/$FILE > /dev/null") | crontab -
|
(crontab -l 2>/dev/null; echo "0 0 * * * ${CURRENT_WORKDIR}/$FILE > /tmp/backup.log") | crontab -
|
||||||
elif [ "$FILE" == "docker-updater.sh" ]; then
|
elif [ "$FILE" == "docker-updater.sh" ]; then
|
||||||
(crontab -l 2>/dev/null; echo "0 3 */4 * * ${CURRENT_WORKDIR}/$FILE > /dev/null") | crontab -
|
(crontab -l 2>/dev/null; echo "0 3 */4 * * ${CURRENT_WORKDIR}/$FILE > /tmp/docker-updater.log") | crontab -
|
||||||
else
|
else
|
||||||
echo -e "${YELLOW}[w] [$FILE] Warning: Crontab specific schedule not setup.${NC}" >&2
|
echo -e "${YELLOW}[w] [$FILE] Warning: Crontab specific schedule not setup.${NC}" >&2
|
||||||
(crontab -l 2>/dev/null; echo "0 0 * * * ${CURRENT_WORKDIR}/$FILE" > /dev/null) | crontab -
|
(crontab -l 2>/dev/null; echo "0 0 * * * ${CURRENT_WORKDIR}/$FILE" > /tmp/$FILE.log) | crontab -
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo -e "${GREEN}[✓] [$FILE] Crontab added, double-checking set up...${NC}"
|
echo -e "${GREEN}[✓] [$FILE] Crontab added, double-checking set up...${NC}"
|
||||||
@ -169,7 +170,6 @@ for FILE in "${FILES[@]}"; do
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
echo -e "${GREEN}[✓] [$FILE] Crontab confirmed.${NC}"
|
echo -e "${GREEN}[✓] [$FILE] Crontab confirmed.${NC}"
|
||||||
fi
|
|
||||||
done
|
done
|
||||||
|
|
||||||
echo -e "${GREEN}[✓] Crontabs all set up.${NC}"
|
echo -e "${GREEN}[✓] Crontabs all set up.${NC}"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user