mirror of
https://github.com/YunoHost-Apps/archivist_ynh.git
synced 2024-09-03 18:15:55 +02:00
use ynh_add_config for cron
This commit is contained in:
parent
9971eb97e7
commit
75cc971fd1
1 changed files with 3 additions and 5 deletions
|
@ -119,9 +119,6 @@ then
|
||||||
# Verify the checksum and backup the file if it's different
|
# Verify the checksum and backup the file if it's different
|
||||||
ynh_backup_if_checksum_is_different --file="/etc/cron.d/$app"
|
ynh_backup_if_checksum_is_different --file="/etc/cron.d/$app"
|
||||||
|
|
||||||
cp ../conf/cron /etc/cron.d/$app
|
|
||||||
ynh_replace_string --match_string="__FINALPATH__" --replace_string="$final_path" --target_file=/etc/cron.d/$app
|
|
||||||
ynh_replace_string --match_string="__APP__" --replace_string=$app --target_file=/etc/cron.d/$app
|
|
||||||
if [ "$frequency" = "Daily" ]; then
|
if [ "$frequency" = "Daily" ]; then
|
||||||
cron_freq="0 2 * * *"
|
cron_freq="0 2 * * *"
|
||||||
run_freq="every day"
|
run_freq="every day"
|
||||||
|
@ -138,7 +135,8 @@ then
|
||||||
cron_freq="0 2 1 * *"
|
cron_freq="0 2 1 * *"
|
||||||
run_freq="once a month on the first sunday"
|
run_freq="once a month on the first sunday"
|
||||||
fi
|
fi
|
||||||
ynh_replace_string --match_string="__FREQUENCY__" --replace_string="$cron_freq" --target_file=/etc/cron.d/$app
|
|
||||||
|
ynh_add_config --template="cron" --destination="/etc/cron.d/$app"
|
||||||
|
|
||||||
# Recalculate and store the config file checksum into the app settings
|
# Recalculate and store the config file checksum into the app settings
|
||||||
ynh_store_file_checksum --file="/etc/cron.d/$app"
|
ynh_store_file_checksum --file="/etc/cron.d/$app"
|
||||||
|
|
Loading…
Reference in a new issue