fixing crontab lol
All checks were successful
Check scripts syntax / check-scripts-syntax (push) Successful in 2s

This commit is contained in:
Jose Henrique 2024-12-29 15:38:04 -03:00
parent 80a1ad59cf
commit 97010d71ff

View File

@ -151,14 +151,14 @@ for FILE in "${FILES[@]}"; do
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") | crontab - (crontab -l 2>/dev/null; echo "0 0 * * * ${CURRENT_WORKDIR}/$FILE > /dev/null") | crontab -
elif [ "$FILE" == "backup.sh" ]; then elif [ "$FILE" == "backup.sh" ]; then
(crontab -l 2>/dev/null; echo "0 0 * * * ${CURRENT_WORKDIR}/$FILE") | crontab - (crontab -l 2>/dev/null; echo "0 0 * * * ${CURRENT_WORKDIR}/$FILE > /dev/null") | 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") | crontab - (crontab -l 2>/dev/null; echo "0 3 */4 * * ${CURRENT_WORKDIR}/$FILE > /dev/null") | 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") | crontab - (crontab -l 2>/dev/null; echo "0 0 * * * ${CURRENT_WORKDIR}/$FILE" > /dev/null) | 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}"