mirror of
https://github.com/YunoHost-Apps/invoiceninja_ynh.git
synced 2024-09-03 19:26:22 +02:00
Merge pull request #2 from YunoHost-Apps/cron
Add Cronjobs to send Recurring invoices and reminder emails
This commit is contained in:
commit
07dffc9ff5
3 changed files with 20 additions and 6 deletions
|
@ -52,11 +52,7 @@ Configuration happens in the application itself.
|
||||||
* Upstream app repository: https://github.com/invoiceninja/invoiceninja
|
* Upstream app repository: https://github.com/invoiceninja/invoiceninja
|
||||||
* YunoHost website: https://yunohost.org/
|
* YunoHost website: https://yunohost.org/
|
||||||
|
|
||||||
|
|
||||||
## TODOs
|
## TODOs
|
||||||
|
|
||||||
* Completely configure the env
|
* If possible, create initial user
|
||||||
* Mail settings
|
|
||||||
* Cronjobs
|
|
||||||
* Create initial user?
|
|
||||||
* Test upgrade
|
* Test upgrade
|
||||||
|
|
3
conf/invoiceninja.cron
Normal file
3
conf/invoiceninja.cron
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
0 8 * * * __USER__ /usr/bin/php__YNH_PHP_VERSION__ __DESTDIR__/artisan ninja:send-invoices -q
|
||||||
|
0 8 * * * __USER__ /usr/bin/php__YNH_PHP_VERSION__ __DESTDIR__/artisan ninja:send-reminders -q
|
||||||
|
|
|
@ -24,6 +24,8 @@ ynh_abort_if_errors
|
||||||
# RETRIEVE ARGUMENTS FROM THE MANIFEST
|
# RETRIEVE ARGUMENTS FROM THE MANIFEST
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
|
YNH_PHP_VERSION="7.0"
|
||||||
|
|
||||||
domain=$YNH_APP_ARG_DOMAIN
|
domain=$YNH_APP_ARG_DOMAIN
|
||||||
path_url=$YNH_APP_ARG_PATH
|
path_url=$YNH_APP_ARG_PATH
|
||||||
admin=$YNH_APP_ARG_ADMIN
|
admin=$YNH_APP_ARG_ADMIN
|
||||||
|
@ -239,6 +241,19 @@ ynh_script_progression --message="Configuring log rotation..."
|
||||||
# Use logrotate to manage application logfile(s)
|
# Use logrotate to manage application logfile(s)
|
||||||
ynh_use_logrotate
|
ynh_use_logrotate
|
||||||
|
|
||||||
|
#=================================================
|
||||||
|
# ADD A CRON JOB
|
||||||
|
#=================================================
|
||||||
|
|
||||||
|
cron_path="/etc/cron.d/$app"
|
||||||
|
cp -a ../conf/invoiceninja.cron "$cron_path"
|
||||||
|
chown root: "$cron_path"
|
||||||
|
chmod 644 "$cron_path"
|
||||||
|
|
||||||
|
ynh_replace_string --match_string="__USER__" --replace_string="$app" --target_file="$cron_path"
|
||||||
|
ynh_replace_string --match_string="__DESTDIR__" --replace_string="$final_path" --target_file="$cron_path"
|
||||||
|
ynh_replace_string --match_string="__YNH_PHP_VERSION__" --replace_string="$YNH_PHP_VERSION" --target_file="$cron_path"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# SETUP FAIL2BAN
|
# SETUP FAIL2BAN
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
Loading…
Add table
Reference in a new issue