chore(gitlab): improve notes about backups

This commit is contained in:
Michele Cereda
2024-06-12 21:46:29 +02:00
parent b890a2718a
commit 15369e804b
9 changed files with 163 additions and 52 deletions

View File

@@ -1,29 +1,56 @@
# Title
## Table of contents <!-- omit in toc -->
# Cron
1. [TL;DR](#tldr)
1. [Sources](#sources)
1. [Further readings](#further-readings)
1. [Sources](#sources)
## TL;DR
Files in `/etc/cron.hourly` and similar need to:
Files in `/etc/cron.hourly` and similar must:
- be executable,
- match the Debian cron script namespace (`^[a-zA-Z0-9_-]+$`, so script **with an extension** won't work).
- Be **scripts**.<br/>
Normal crontab files will error out.
- Be **executable**.<br/>
If not executable, execution will silently fail.
- Match the Debian cron script namespace (`^[a-zA-Z0-9_-]+$`).<br/>
Files **with** an extension **won't** work.
```sh
systemctl --enable --now 'crond.service'
journalctl -xefu 'crond.service'
# Validate crontab files.
crontab -T '/etc/cron.d/prometheus-backup'
# List files in given directories.
# Kinda… useless?
run-parts --list '/etc/cron.daily'
# Print the names of the scripts which would be invoked.
sudo run-parts --report --test '/etc/cron.hourly'
# '--report' is *not* available everywhere.
run-parts --report --test '/etc/cron.hourly'
# Manually run crontab files in given directories.
run-parts '/etc/cron.weekly'
```
## Sources
## Further readings
- [Crontab]
### Sources
- [Function of /etc/cron.hourly]
- [Use anacron for a better crontab]
<!--
References
Reference
═╬═Time══
-->
<!-- Knowledge base -->
[crontab]: crontab.md
<!-- Others -->
[Function of /etc/cron.hourly]: https://askubuntu.com/questions/7676/function-of-etc-cron-hourly#607974
[function of /etc/cron.hourly]: https://askubuntu.com/questions/7676/function-of-etc-cron-hourly#607974
[use anacron for a better crontab]: https://opensource.com/article/21/2/linux-automation