mirror of
https://github.com/YunoHost-Apps/grav_ynh.git
synced 2024-09-03 19:16:01 +02:00
Add the cron job
This commit is contained in:
parent
12e86653bc
commit
c8a764154c
5 changed files with 32 additions and 2 deletions
|
@ -45,13 +45,19 @@ ynh_backup --src_path="$final_path"
|
||||||
# BACKUP THE NGINX CONFIGURATION
|
# BACKUP THE NGINX CONFIGURATION
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
ynh_backup "/etc/nginx/conf.d/$domain.d/$app.conf"
|
ynh_backup --src_path="/etc/nginx/conf.d/$domain.d/$app.conf"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# BACKUP THE PHP-FPM CONFIGURATION
|
# BACKUP THE PHP-FPM CONFIGURATION
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
ynh_backup "/etc/php/${phpversion}/fpm/pool.d/$app.conf"
|
ynh_backup --src_path="/etc/php/${phpversion}/fpm/pool.d/$app.conf"
|
||||||
|
|
||||||
|
#=================================================
|
||||||
|
# BACKUP CRON
|
||||||
|
#=================================================
|
||||||
|
|
||||||
|
ynh_backup --src_path="/etc/cron.d/$app"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# END OF SCRIPT
|
# END OF SCRIPT
|
||||||
|
|
|
@ -118,6 +118,12 @@ ynh_replace_string "__ADMIN__" "$admin" "$final_path/user/plugins/login-ldap/log
|
||||||
ynh_replace_string "__APP__" "$app" "$final_path/user/plugins/login-ldap/login-ldap.yaml"
|
ynh_replace_string "__APP__" "$app" "$final_path/user/plugins/login-ldap/login-ldap.yaml"
|
||||||
exec_as $app cp "$final_path/user/plugins/login-ldap/login-ldap.yaml" "$final_path/user/config/plugins/login-ldap.yaml"
|
exec_as $app cp "$final_path/user/plugins/login-ldap/login-ldap.yaml" "$final_path/user/config/plugins/login-ldap.yaml"
|
||||||
|
|
||||||
|
#=================================================
|
||||||
|
# CREATE A CRON TASK
|
||||||
|
#=================================================
|
||||||
|
|
||||||
|
echo "* * * * * $app php$phpversion $final_path/bin/grav scheduler 1>> /dev/null 2>&1" > /etc/cron.d/$app
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# SETUP PERMISSIONS
|
# SETUP PERMISSIONS
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
|
@ -31,6 +31,12 @@ ynh_script_progression --message="Removing dependencies..." --weight=2
|
||||||
# Remove metapackage and its dependencies
|
# Remove metapackage and its dependencies
|
||||||
ynh_remove_app_dependencies
|
ynh_remove_app_dependencies
|
||||||
|
|
||||||
|
#=================================================
|
||||||
|
# REMOVE THE CRON
|
||||||
|
#=================================================
|
||||||
|
|
||||||
|
ynh_secure_remove --file="/etc/cron.d/$app"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# REMOVE APP MAIN DIR
|
# REMOVE APP MAIN DIR
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
|
@ -79,6 +79,12 @@ find $final_path/bin -type f -exec chmod 775 {} \;
|
||||||
find $final_path -type d -exec chmod 775 {} \;
|
find $final_path -type d -exec chmod 775 {} \;
|
||||||
find $final_path -type d -exec chmod +s {} \;
|
find $final_path -type d -exec chmod +s {} \;
|
||||||
|
|
||||||
|
#=================================================
|
||||||
|
# RESTORE THE CRON
|
||||||
|
#=================================================
|
||||||
|
|
||||||
|
ynh_restore_file --origin_path="/etc/cron.d/$app"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# RESTORE THE PHP-FPM CONFIGURATION
|
# RESTORE THE PHP-FPM CONFIGURATION
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
|
@ -183,6 +183,12 @@ ynh_replace_string "__ADMIN__" "$admin" "$final_path/user/plugins/login-ldap/log
|
||||||
ynh_replace_string "__APP__" "$app" "$final_path/user/plugins/login-ldap/login-ldap.yaml"
|
ynh_replace_string "__APP__" "$app" "$final_path/user/plugins/login-ldap/login-ldap.yaml"
|
||||||
exec_as $app cp "$final_path/user/plugins/login-ldap/login-ldap.yaml" "$final_path/user/config/plugins/login-ldap.yaml"
|
exec_as $app cp "$final_path/user/plugins/login-ldap/login-ldap.yaml" "$final_path/user/config/plugins/login-ldap.yaml"
|
||||||
|
|
||||||
|
#=================================================
|
||||||
|
# CREATE A CRON TASK
|
||||||
|
#=================================================
|
||||||
|
|
||||||
|
echo "* * * * * $app php$phpversion $final_path/bin/grav scheduler 1>> /dev/null 2>&1" > /etc/cron.d/$app
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# SETUP PERMISSIONS
|
# SETUP PERMISSIONS
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
Loading…
Reference in a new issue