2017-11-01 20:57:58 +01:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
#=================================================
|
2021-11-20 10:08:45 +01:00
|
|
|
# COMMON VARIABLES
|
2017-11-01 20:57:58 +01:00
|
|
|
#=================================================
|
|
|
|
|
2022-07-16 19:44:33 +02:00
|
|
|
#=================================================
|
|
|
|
# PERSONAL HELPERS
|
|
|
|
#=================================================
|
2020-05-02 00:51:36 +02:00
|
|
|
|
2024-03-29 12:47:49 +01:00
|
|
|
_set_frequencies() {
|
|
|
|
case "$frequency" in
|
|
|
|
daily)
|
|
|
|
frequency_cron="0 2 * * *"
|
|
|
|
frequency_human="every day"
|
|
|
|
;;
|
|
|
|
days_3)
|
|
|
|
frequency_cron="0 2 */3 * *"
|
|
|
|
frequency_human="each 3 days"
|
|
|
|
;;
|
|
|
|
weekly)
|
|
|
|
frequency_cron="0 2 * * 0"
|
|
|
|
frequency_human="once a week on sunday"
|
|
|
|
;;
|
|
|
|
weeks_2)
|
|
|
|
frequency_cron="0 2 * * 0/2"
|
|
|
|
frequency_human="one sunday out of two"
|
|
|
|
;;
|
|
|
|
monthly)
|
|
|
|
frequency_cron="0 2 1 * *"
|
|
|
|
frequency_human="once a month on the first sunday"
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
ynh_die --message="Unsupported frequency $frequency" ;;
|
|
|
|
esac
|
|
|
|
|
|
|
|
# For POST_INSTALL.md
|
|
|
|
ynh_app_setting_set --app="$app" --key=frequency_human --value="$frequency_human"
|
|
|
|
}
|
|
|
|
|
2019-01-30 19:56:49 +01:00
|
|
|
#=================================================
|
|
|
|
# EXPERIMENTAL HELPERS
|
|
|
|
#=================================================
|
|
|
|
|
2018-03-14 23:20:44 +01:00
|
|
|
#=================================================
|
2024-03-29 12:47:49 +01:00
|
|
|
# FUTURE OFFICIAL HELPERS
|
2019-01-13 17:19:46 +01:00
|
|
|
#=================================================
|