improving
All checks were successful
Check scripts syntax / check-scripts-syntax (push) Successful in 28s

This commit is contained in:
2024-12-28 21:13:05 -03:00
parent 86bd2f0793
commit 72272cacac
3 changed files with 35 additions and 8 deletions

View File

@@ -149,7 +149,17 @@ for FILE in "${FILES[@]}"; do
echo -e "${LIGHT_BLUE}[i] [$FILE] Crontab already exists. Skipping.${NC}"
else
echo -e "${LIGHT_BLUE}[i] [$FILE] Adding crontab...${NC}"
(crontab -l 2>/dev/null; echo "0 0 * * * ${CURRENT_WORKDIR}/$FILE") | crontab -
if [ "$FILE" == "clean.sh" ]; then
(crontab -l 2>/dev/null; echo "0 0 * * * ${CURRENT_WORKDIR}/$FILE") | crontab -
elif [ "$FILE" == "backup.sh" ]; then
(crontab -l 2>/dev/null; echo "0 0 * * * ${CURRENT_WORKDIR}/$FILE") | crontab -
elif [ "$FILE" == "docker-updater.sh" ]; then
(crontab -l 2>/dev/null; echo "0 3 */4 * * ${CURRENT_WORKDIR}/$FILE") | crontab -
else
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 -
fi
echo -e "${GREEN}[✓] [$FILE] Crontab added, double-checking set up...${NC}"