bluefeds.md: add user's crontab and modify root crontab; remove maintenance script (moved to dots-bluefeds)
This commit is contained in:
parent
c2f39eb64b
commit
569208ad03
|
@ -370,29 +370,42 @@ systemctl --user enable container-caddy-vishwambhar container-gitea-chitragupta
|
||||||
|
|
||||||
### user crontab
|
### user crontab
|
||||||
|
|
||||||
```bash {linenos=true}
|
```bash
|
||||||
# empty for now
|
# 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
|
### root crontab
|
||||||
|
|
||||||
|
```bash
|
||||||
```bash {linenos=true}
|
|
||||||
# update fs database every 6 hours
|
# update fs database every 6 hours
|
||||||
* */6 * * * updatedb
|
* */6 * * * updatedb
|
||||||
|
|
||||||
|
# create zfs snapshots every Friday
|
||||||
|
0 0 * * 5 bash /home/pratham/.scripts/cron/root/zfs-bak.sh
|
||||||
|
|
||||||
# start scrub
|
# start scrub
|
||||||
# on the first Friday of every month
|
# on the first Friday of every month
|
||||||
# at 2100 hours
|
# at 2100 hours
|
||||||
0 21 * * 5 [ $(date +\%d) -le 07 ] && /sbin/zpool scrub
|
0 21 * * 5 [ $(date +\%d) -le 07 ] && /sbin/zpool scrub
|
||||||
|
|
||||||
# maintenance script
|
# maintenance script
|
||||||
0 20 * * * bash /home/pratham/.scripts/cron/root/maintenance.sh
|
#0 20 * * * bash /home/pratham/.scripts/cron/root/maintenance.sh
|
||||||
```
|
|
||||||
|
|
||||||
```maintenance.sh
|
|
||||||
#!/usr/bin/env bash
|
|
||||||
|
|
||||||
find / -type f -name "*.DS_Store" -exec rm {} \;
|
|
||||||
```
|
```
|
||||||
|
|
Loading…
Reference in New Issue