(Fresh install) Automatics backups aren't working

Hello,

I did a fresh install with one website one week ago, I tried almost everything to make automatic backups working, but there is just nothing happening

There is also one thing I don’t understand:

31 05 * * * sudo /usr/local/hestia/bin/v-backup-user myuser

I tried to create this cron in order to get an automatic backup via cron (because the “normal” one wasn’t doing anything) and this one is still not working BUT if I do it in SSH, it works

Do you know what could be the issue?

Thanks in advance and have a nice day!

crontab -e -u hestiaweb

There is a task to run the backup:

10 03 * * * sudo /usr/local/hestia/bin/v-backup-users

You can edit the startup time to suit your needs.

Also check if the cron service is running - service cron status

The task is here + the cron service is running

● cron.service - Regular background program processing daemon
     Loaded: loaded (/usr/lib/systemd/system/cron.service; enabled; preset: enabled)
     Active: active (running) since Mon 2025-03-03 23:16:15 EET; 57min ago
       Docs: man:cron(8)
   Main PID: 875 (cron)
      Tasks: 1 (limit: 2265)
     Memory: 1.8M (peak: 6.6M)
        CPU: 188ms
     CGroup: /system.slice/cron.service
             └─875 /usr/sbin/cron -f -P

Mar 03 23:55:01 xxx.vultrusercontent.com CRON[6452]: pam_unix(cron:session): session closed for user root
Mar 03 23:59:01 xxx.vultrusercontent.com CRON[6518]: pam_unix(cron:session): session opened for user root(uid=0) by root(uid=0)
Mar 03 23:59:01 xxx.vultrusercontent.com CRON[6519]: (root) CMD (command -v debian-sa1 > /dev/null && debian-sa1 60 2)
Mar 03 23:59:01 xxx.vultrusercontent.com CRON[6518]: pam_unix(cron:session): session closed for user root
Mar 04 00:05:01 xxxvultrusercontent.com CRON[6656]: pam_unix(cron:session): session opened for user root(uid=0) by root(uid=0)
Mar 04 00:05:01 xxx.vultrusercontent.com CRON[6657]: (root) CMD (command -v debian-sa1 > /dev/null && debian-sa1 1 1)
Mar 04 00:05:01 xxx.vultrusercontent.com CRON[6656]: pam_unix(cron:session): session closed for user root
Mar 04 00:09:01 xxx.vultrusercontent.com CRON[6692]: pam_unix(cron:session): session opened for user root(uid=0) by root(uid=0)
Mar 04 00:09:01 xxx.vultrusercontent.com CRON[6694]: (root) CMD (  [ -x /usr/lib/php/sessionclean ] && if [ ! -d /run/systemd/system ]; then /usr/lib/php/sessionclean; fi)
Mar 04 00:09:01 xxx.vultrusercontent.com CRON[6692]: pam_unix(cron:session): session closed for user root

But nothing happen when it should be doing the backup :frowning:

show output of crontab -l -u hestiaweb

10 0 * * * sudo /usr/local/hestia/bin/v-update-sys-queue daily

40 2 * * * sudo /usr/local/hestia/bin/v-update-letsencrypt-ssl

*/5 * * * * sudo /usr/local/hestia/bin/v-update-sys-queue backup

10 03 * * * sudo /usr/local/hestia/bin/v-backup-users

Look at the logs - /var/log/hestia/backup.log

Backup.log is empty (0kb) and on system.log when I do ctrl+f there is no backup, it’s like there is really nothing happening

Run

/usr/local/hestia/bin/v-backup-users

in console

================================

user

--------------------------------

-- SYSTEM --

2025-03-04 00:49:30 user.conf

2025-03-04 00:49:30 stats.log

2025-03-04 00:49:30 history.log

2025-03-04 00:49:30 pam

-- WEB --

2025-03-04 00:49:30 site.site

2025-03-04 00:49:31 *** 1 domain ***

-- DB --

2025-03-04 00:49:31 *** 0 databases ***

-- CRON --

2025-03-04 00:49:31 *** 0 jobs ***

-- USER DIRECTORIES --

2025-03-04 00:49:31 adding .bash_logout

2025-03-04 00:49:31 adding .bashrc

2025-03-04 00:49:31 adding .cache

2025-03-04 00:49:31 adding .composer

2025-03-04 00:49:31 adding .config

2025-03-04 00:49:31 adding .local

2025-03-04 00:49:31 adding .npm

2025-03-04 00:49:31 adding .profile

2025-03-04 00:49:31 adding .ssh

2025-03-04 00:49:31 adding .vscode-server

2025-03-04 00:49:31 adding .wp-cli

2025-03-04 00:49:31 *** 11 directories ***

-- SUMMARY --

2025-03-04 00:49:31 Remote: hidden.tar

2025-03-04 00:49:33 Rotated sftp backup: 2025-03-04_00-44-51

2025-03-04 00:49:33 Uploading hidden.tar

2025-03-04 00:49:34 Size: 3 MB

2025-03-04 00:49:34 Runtime: 1 minute

--------------------------------

It’s strange because yes this way it works

There are no problems according to the logs. Most likely you have 1 backup copy that is saved. Change the settings in the package.

I had no backups, but I changed it to 10, I changed the cron to 01 03 so it would run at 1:03 (which was in 4 minutes)

It still did nothing :frowning:

Judging by everything you gave, everything should work. Unfortunately, if I need to look at your server, it is already paid for on my part. Since it is my time. The answers on this forum are advisory in nature.

Yes, sure, that’s totally understandable! Thank you for your help

That means it will run at 03:01.

Show the output of these commands:

grep 'CRON.*v-backup' /var/log/syslog
cat /etc/sudoers.d/hestiaweb
exim4 -bp
2 Likes

Oh okay thank you, my bad for that (it still didn’t run at 03:01 though)

Output:

root@95:~# /usr/local/hestia/bin/v-backup-users

root@95:~# grep 'CRON.*v-backup' /var/log/syslog

root@95:~# cat /etc/sudoers.d/hestiaweb

Defaults:root !requiretty

# sudo is limited to hestia scripts

hestiaweb ALL=NOPASSWD:/usr/local/hestia/bin/*

root@95:~# exim4 -bp

Command 'exim4' not found, but can be installed with:

apt install exim4-daemon-heavy # version 4.97-4ubuntu4.1, or

apt install exim4-daemon-light # version 4.97-4ubuntu4.1

Can you see any other CRON entries in syslog?

grep CRON /var/log/syslog | tail -n15

If you can’t see any entry:

apt update
apt full-upgrade
apt autoremove
apt clean
apt reinstall cron

And try to run a cron job again modifying the time execution for that cron job.

2025-03-04T16:05:01.908763+02:00 95 CRON[38025]: (root) CMD (command -v debian-sa1 > /dev/null && debian-sa1 1 1)

2025-03-04T16:09:01.923789+02:00 95 CRON[38128]: (root) CMD ( [ -x /usr/lib/php/sessionclean ] && if [ ! -d /run/systemd/system ]; then /usr/lib/php/sessionclean; fi)

2025-03-04T16:15:01.936702+02:00 95 CRON[38154]: (root) CMD (command -v debian-sa1 > /dev/null && debian-sa1 1 1)

2025-03-04T16:17:01.947811+02:00 95 CRON[38163]: (root) CMD (cd / && run-parts --report /etc/cron.hourly)

2025-03-04T16:25:01.968942+02:00 95 CRON[38204]: (root) CMD (command -v debian-sa1 > /dev/null && debian-sa1 1 1)

2025-03-04T16:35:01.988096+02:00 95 CRON[38245]: (root) CMD (command -v debian-sa1 > /dev/null && debian-sa1 1 1)

2025-03-04T16:39:02.018939+02:00 95 CRON[38312]: (root) CMD ( [ -x /usr/lib/php/sessionclean ] && if [ ! -d /run/systemd/system ]; then /usr/lib/php/sessionclean; fi)

2025-03-04T16:45:01.036599+02:00 95 CRON[38358]: (root) CMD (command -v debian-sa1 > /dev/null && debian-sa1 1 1)

2025-03-04T16:55:01.050725+02:00 95 CRON[38550]: (root) CMD (command -v debian-sa1 > /dev/null && debian-sa1 1 1)

2025-03-04T17:05:01.067787+02:00 95 CRON[38664]: (root) CMD (command -v debian-sa1 > /dev/null && debian-sa1 1 1)

2025-03-04T17:09:01.091475+02:00 95 CRON[38699]: (root) CMD ( [ -x /usr/lib/php/sessionclean ] && if [ ! -d /run/systemd/system ]; then /usr/lib/php/sessionclean; fi)

2025-03-04T17:15:01.106884+02:00 95 CRON[38771]: (root) CMD (command -v debian-sa1 > /dev/null && debian-sa1 1 1)

2025-03-04T17:17:01.115722+02:00 95 CRON[38930]: (root) CMD (cd / && run-parts --report /etc/cron.hourly)

2025-03-04T17:25:01.131808+02:00 95 CRON[38966]: (root) CMD (command -v debian-sa1 > /dev/null && debian-sa1 1 1)

2025-03-04T17:35:01.153114+02:00 95 CRON[39101]: (root) CMD (command -v debian-sa1 > /dev/null && debian-sa1 1 1)

cron is working.

Show the output of these commands:

namei -mo /var/spool/cron/crontabs/hestiaweb
cat -A /var/spool/cron/crontabs/hestiaweb

First one:

root@95:~# namei -mo /var/spool/cron/crontabs/hestiaweb
f: /var/spool/cron/crontabs/hestiaweb
 drwxr-xr-x root      root      /
 drwxr-xr-x root      root      var
 drwxr-xr-x root      root      spool
 drwxr-xr-x root      root      cron
 drwx-wx--T root      crontab   crontabs
 -rw------- hestiaweb hestiaweb hestiaweb

Second one:

root@95:~# cat -A /var/spool/cron/crontabs/hestiaweb

MAILTO=""$

CONTENT_TYPE="text/plain; charset=utf-8"$

10 0 * * * sudo /usr/local/hestia/bin/v-update-sys-queue daily$

40 2 * * * sudo /usr/local/hestia/bin/v-update-letsencrypt-ssl$

*/5 * * * * sudo /usr/local/hestia/bin/v-update-sys-queue backup$

18 00 * * * sudo /usr/local/hestia/bin/v-backup-users

The permissions are correct, and the contents of the crontab are fine… Well, I’m missing a few scripts there, but it should work with the ones you have.

Just in case, reboot your server if you haven’t already done so.