Backups not running

Discussion in 'ISPConfig 3 Priority Support' started by DylanPedro, Mar 8, 2018.

  1. DylanPedro

    DylanPedro Member HowtoForge Supporter

    Have setup some backup and cant see the are running when executing the following from the command line:
    Code:
    php /usr/local/ispconfig/server/cron_debug.php --cronjob=500-backup.inc.php
    The backups are set to run daily and a maximum of 10 but after 24 hours no no backup have been created?
     
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    Which kind of backup is not working? Mail, web, database? And when there is no further debug output shown, then there is no further debug output in that specific plugin.
     
  3. DylanPedro

    DylanPedro Member HowtoForge Supporter

    Hi Till,

    Neither the web or database backups run for any of the configured site. I've set it up on the backup tab and left it for tow days too see if it runs at midnight but nothing happens. How would I debug this?

    Running the following works:
    Code:
    php /usr/local/ispconfig/server/cron_debug.php --cronjob=500-backup.inc.php
    It just doesn't run daily at midnight as expected?
     
  4. till

    till Super Moderator Staff Member ISPConfig Developer

    Ok, so the backup is working but the cronjob is not running. Check your root crontab with:

    crontab -e

    it has to contain this line.

    Code:
    * * * * * /usr/local/ispconfig/server/cron.sh 2>&1 | while read line; do echo `/bin/date` "$line" >> /var/log/ispconfig/cron.log; done
     
  5. DylanPedro

    DylanPedro Member HowtoForge Supporter

    Have the following in there:
    Code:
    * * * * * /usr/local/ispconfig/server/server.sh 2>&1 | while read line; do echo `/bin/date` "$line" >> /var/log/ispconfig/cron.log; done
    * * * * * /usr/local/ispconfig/server/cron.sh 2>&1 | while read line; do echo `/bin/date` "$line" >> /var/log/ispconfig/cron.log; done
    0 0 * * * /usr/local/ispconfig/server/scripts/create_daily_nginx_access_logs.sh &> /dev/null
     
  6. till

    till Super Moderator Staff Member ISPConfig Developer

    That should be ok. Any errors when you run this command as root?

    /usr/local/ispconfig/server/cron.sh

    And other changes in ISPConfig get executed, or are they stuck in the queue as well?
     
  7. DylanPedro

    DylanPedro Member HowtoForge Supporter

    No errors when running that command, and all other changes get executed, as in the flashing circle appears in top right hand corner after a change then goes away?
     
  8. till

    till Super Moderator Staff Member ISPConfig Developer

    Then I must admit that I have no real idea, the backups are working when you run the plugin and the cronjob script does not return any errors. What you might try thoug is to edit the crontab with 'crontab -e' command, comment out a cronjob by adding a # in front, save and exit the editor. then do the same again and remove the comment. This forces the cron daemon to reload the crontab, maybe that helps.
     
  9. DylanPedro

    DylanPedro Member HowtoForge Supporter

    I commented it out and ran the previous cron and go the following output:
    Code:
    #/usr/local/ispconfig/server/cron.sh
    c0_aps1 does not exceed quota qize: 0 > 10551296
    c0_magento does not exceed quota qize: -1048576 > 18284544
    c0_magento_dev does not exceed quota qize: -1048576 > 40304640
    c0_roundcubemail does not exceed quota qize: -1048576 > 688128
    c0_wordpressdb does not exceed quota qize: -1048576 > 56332288
    c1_aps1 does not exceed quota qize: 0 > 44154880
    c2_aps1 does not exceed quota qize: 0 > 13975552
    /usr/bin/fail2ban-client
    /sbin/iptables
    /sbin/ip6tables
    /usr/bin/rkhunter
    But this is the same as what is seen in the "Show ISPC Cron-Log" section in the admin, nothing about backup script in there though?
     
  10. till

    till Super Moderator Staff Member ISPConfig Developer

    The backup scripts runs once a night, so it is not run at every cron run.
     
  11. DylanPedro

    DylanPedro Member HowtoForge Supporter

    Hi Till,

    I waited till midnight but the backup still did not run, is there a way to debug this to see if the script is even being called to run at midnight?
     
  12. till

    till Super Moderator Staff Member ISPConfig Developer

    If your system has a cron log file, then you should find it there, or it might be just in the syslog file. Probably a grep in the files for cron.sh might help to see if it gets executed once per minute.
     
  13. DylanPedro

    DylanPedro Member HowtoForge Supporter

    cron.sh is defiantly running in the syslog
    Code:
    Mar  9 11:57:01 server1 CRON[15336]: (root) CMD (/usr/local/ispconfig/server/cron.sh 2>&1 | while read line; do echo `/bin/date` "$line" >> /var/log/ispconfig/cron.log; done)
    Mar  9 11:58:01 server1 CRON[17520]: (root) CMD (/usr/local/ispconfig/server/cron.sh 2>&1 | while read line; do echo `/bin/date` "$line" >> /var/log/ispconfig/cron.log; done)
    And the cron.log also has entries:
    Code:
    Fri Mar 9 11:57:01 UTC 2018
    Fri Mar 9 11:57:01 UTC 2018
    Fri Mar 9 11:57:01 UTC 2018 c0_aps1 does not exceed quota qize: 0 > 10551296
    Fri Mar 9 11:57:01 UTC 2018 finished.
    Fri Mar 9 11:57:01 UTC 2018 c0_magento does not exceed quota qize: -1048576 > 18153472
    Fri Mar 9 11:57:02 UTC 2018 c0_magento_dev does not exceed quota qize: -1048576 > 40173568
    Fri Mar 9 11:57:02 UTC 2018 c0_roundcubemail does not exceed quota qize: -1048576 > 688128
    Fri Mar 9 11:57:02 UTC 2018 c0_wordpressdb does not exceed quota qize: -1048576 > 56332288
    Fri Mar 9 11:57:02 UTC 2018 c1_aps1 does not exceed quota qize: 0 > 45072384
    Fri Mar 9 11:57:02 UTC 2018 c2_aps1 does not exceed quota qize: 0 > 13959168
    Fri Mar 9 11:57:02 UTC 2018 /usr/bin/fail2ban-client
    Fri Mar 9 11:57:02 UTC 2018 /sbin/iptables
    Fri Mar 9 11:57:02 UTC 2018 /sbin/ip6tables
    Fri Mar 9 11:57:02 UTC 2018 /usr/bin/rkhunter
    Fri Mar 9 11:58:02 UTC 2018
    Fri Mar 9 11:58:02 UTC 2018
    But how can I find out the 500-backup.inc.php script is being called at midnight as there is no mention of that in either?
     
  14. till

    till Super Moderator Staff Member ISPConfig Developer

    The backup script has no further debug code as far as I know, so probably the only option will be that you add some debug code in there to see if it is run.
     
  15. DylanPedro

    DylanPedro Member HowtoForge Supporter

    Any guidance on how I would do this and where the 500-backup.inc.php script is located as it is included with ispconfig?
     
  16. till

    till Super Moderator Staff Member ISPConfig Developer

    The cron plugins are in the folder /usr/local/ispconfig/server/lib/classes/cron.d/
     
  17. till

    till Super Moderator Staff Member ISPConfig Developer

    I just talked with @Croydon and he reminded me that he fixed an issue in the backup system which might be related to your issue. Please use this command to install the latest version of the backup plugin, maybe this solves the issue:

    Code:
    wget -O /usr/local/ispconfig/server/lib/classes/cron.d/500-backup.inc.php https://git.ispconfig.org/ispconfig/ispconfig3/raw/stable-3.1/server/lib/classes/cron.d/500-backup.inc.php
     
  18. DylanPedro

    DylanPedro Member HowtoForge Supporter

    Hi Till,

    I installed this script as suggested, and left the server running for a few days after a reboot, still no backups at midnight only when script is called manually?
     
  19. till

    till Super Moderator Staff Member ISPConfig Developer

    Ok, then there might be a different issue on your system. as mentioned above, you might try to debug it or contact Florian from business support team if you need help by remote login.
     

Share This Page