1
0
Fork 0

bluefeds.md: add user's crontab and modify root crontab; remove maintenance script (moved to dots-bluefeds)

This commit is contained in:
Pratham Patel 2022-07-29 16:58:38 +05:30
parent c2f39eb64b
commit 569208ad03
1 changed files with 24 additions and 11 deletions

View File

@ -370,29 +370,42 @@ systemctl --user enable container-caddy-vishwambhar container-gitea-chitragupta
### user crontab
```bash {linenos=true}
# empty for now
```bash
# power down containers before a snapshot is taken on 00:00 Fridays
45 23 * * 4 systemctl --user stop container-caddy-vishwambhar container-gitea-chitragupta container-gitea-govinda container-hugo-mahayogi container-hugo-vaikunthnatham container-nextcloud-chitragupta container-nextcloud-govinda container-nextcloud-karm
a
# start containers after a snapshot is taken on 00:00 Fridays
10 00 * * 5 systemctl --user start container-caddy-vishwambhar container-gitea-chitragupta container-gitea-govinda container-hugo-mahayogi container-hugo-vaikunthnatham container-nextcloud-chitragupta container-nextcloud-govinda container-nextcloud-kar
ma
# a zfs scrub takes place on the first Friday of every month
# this is done at 21:00 hours
# so stop all containers before the scrub takes place
45 20 * * 5 [ $(date +\%d) -le 07 ] && systemctl --user stop container-caddy-vishwambhar container-gitea-chitragupta container-gitea-govinda container-hugo-mahayogi container-hugo-vaikunthnatham container-nextcloud-chitragupta container-nextcloud-govinda container-nextcloud-karma
# maintenance script
# [[ if zpool scrub is not running ]]
# -> [[ if containers are not running ]]
# -> start containers
* * * * * bash /home/pratham/.scripts/cron/pratham/maintenance.sh
```
### root crontab
```bash {linenos=true}
```bash
# update fs database every 6 hours
* */6 * * * updatedb
# create zfs snapshots every Friday
0 0 * * 5 bash /home/pratham/.scripts/cron/root/zfs-bak.sh
# start scrub
# on the first Friday of every month
# at 2100 hours
0 21 * * 5 [ $(date +\%d) -le 07 ] && /sbin/zpool scrub
# maintenance script
0 20 * * * bash /home/pratham/.scripts/cron/root/maintenance.sh
```
```maintenance.sh
#!/usr/bin/env bash
find / -type f -name "*.DS_Store" -exec rm {} \;
#0 20 * * * bash /home/pratham/.scripts/cron/root/maintenance.sh
```