Add uberspace crontab handling
This commit is contained in:
11
bundles/uberspace-crontab-dir/files/crontab-dir-generate-crontab.sh
Executable file
11
bundles/uberspace-crontab-dir/files/crontab-dir-generate-crontab.sh
Executable file
@@ -0,0 +1,11 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
echo "# Generated from ~/.config/cron.d"
|
||||
echo "# Use crontab-dir-update to regenerate"
|
||||
echo
|
||||
echo "PATH=$HOME/.local/bin:$HOME/bin:\$PATH"
|
||||
echo
|
||||
|
||||
find $HOME/.config/cron.d -mindepth 1 -maxdepth 1 -type f | sort | xargs cat
|
11
bundles/uberspace-crontab-dir/files/crontab-dir-is-sync.sh
Executable file
11
bundles/uberspace-crontab-dir/files/crontab-dir-is-sync.sh
Executable file
@@ -0,0 +1,11 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
if [[ "$(crontab-dir-generate-crontab)" == "$(crontab -l)" ]]; then
|
||||
echo "crontab is up to date"
|
||||
exit 0
|
||||
else
|
||||
echo "crontab needs update"
|
||||
exit 1
|
||||
fi
|
5
bundles/uberspace-crontab-dir/files/crontab-dir-update.sh
Executable file
5
bundles/uberspace-crontab-dir/files/crontab-dir-update.sh
Executable file
@@ -0,0 +1,5 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
crontab-dir-generate-crontab | crontab -
|
Reference in New Issue
Block a user