cPanel backups stopped being made suddenly

postcd

Well-Known Member
Oct 22, 2010
717
19
68
Hello,

i noticed that for past many days daily backups suddenly stopped being created by WHM (im doing local backups (no Legacy ones) to the WHM server hard drive)

I checked Backup configuration from WHM and backups are enabled. It just suddenly stopped and no new backups are automatically made by schedule.

# df -h | grep -v virtfs
Filesystem Size Used Avail Use% Mounted on
/dev/simfs 342G 172G 171G 51% /
none 8.6G 4.0K 8.6G 1% /dev
none 8.6G 0 8.6G 0% /dev/shm
tmpfs 2.0G 4.0K 2.0G 1% /tmp/mysqlt
(so there is enough space i assume)

# ls -lt /usr/local/cpanel/logs/cpbackup | head
total 11432
drwx--x--x 7 root root 4096 Oct 9 04:44 ../
-rw------- 1 root root 679851 Oct 8 03:47 1444269604.log
drwx------ 2 root root 4096 Oct 8 02:00 ./
-rw------- 1 root root 1125180 Oct 7 05:16 1444183203.log
-rw------- 1 root root 1115626 Oct 6 05:19 1444096803.log
-rw------- 1 root root 1094534 Oct 5 05:09 1444010402.log
-rw------- 1 root root 1092432 Oct 4 05:05 1443924004.log
-rw------- 1 root root 1089709 Oct 3 05:00 1443837602.log
-rw------- 1 root root 1089420 Oct 2 04:45 1443751203.log
(last backup log file is Oct 8, now is Oct 19)

# ps ax | grep back
16777 ? SNs 0:01 /usr/local/cpanel/3rdparty/bin/perl /usr/local/cpanel/bin/backup
18130 ? ZNs 0:00 [cpbackup_transp] <defunct>
18131 ? SN 0:45 /usr/local/cpanel/bin/cpuwatch 7.0 /usr/local/cpanel/scripts/pkgacct sdooojmm /backup/2015-10-08/accounts backup
18648 pts/0 S+ 0:00 grep back
Please any ideas what to do to make backups working again?

Someone mentioned how to run backup manually, but i assume it do not solve the issue i have?
# /usr/local/cpanel/bin/backup --force

thank you
 
Last edited:

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,909
2,228
463
Hello :)

Check to ensure the "crond" service is running on your system. You can restart it via:

Code:
service crond restart
Also, you should kill those hanging backup processes. EX:

Code:
kill -9 PID
Thank you.
 

postcd

Well-Known Member
Oct 22, 2010
717
19
68
SOLVED
Thanks alot Michael, that helped. Crond was running, so i restarted it. Then i killed these hanged backup processes as you suggested and today i see new daily backups was created. Not sure why backup processes was hanged, but it appears backups are working again now.
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,909
2,228
463
I am happy to see the issue is now resolved. Thank you for updating us with the outcome.
 

postcd

Well-Known Member
Oct 22, 2010
717
19
68
The issue repeats, please is there any command that i can run via cron to automatically kill the backup processes if they run too long? time?
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,909
2,228
463
The issue repeats, please is there any command that i can run via cron to automatically kill the backup processes if they run too long? time?
It's a better idea to terminate the backup process and then remove the temporary backup archive data for the account so that it's generated successfully on the next backup attempt. Otherwise, you risk corrupted restore data if you kill the parent process before the backup completes.

Thank you.
 

postcd

Well-Known Member
Oct 22, 2010
717
19
68
Because issue with hanged backups continued i tried to add this script into crontab:
Code:
#!/bin/bash
# This script will kill process which running more than X hours
# egrep: only processes matching set phrasses
# grep: only processes running more than X (30) hours

PIDS="`ps eaxo bsdtime,pid,comm | egrep "pkgacc|pkgggg|pkkkkk" | grep " 30:" | awk '{print $2}'`"
for pid in ${PIDS}; do { kill -9 $pid; }; done;
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,909
2,228
463
Because issue with hanged backups continued i tried to add this script into crontab:
Hello @postcd,

Have you considered opening a support ticket so we can take a closer look and determine why your backup processes are hanging?

Thank you.
 

johnbVegas

Member
May 24, 2021
6
1
1
?
cPanel Access Level
Website Owner
Does CPanel offer a automated backup that is an app or can be executed with a cron job that would backup the last week or month for a file? It would date it so you can find a particular file by date. I just want to backup one file that is created every day with a php script but this file gets overwritten each day by script.

Thanks
 

cPAdminsMichael

Well-Known Member
Dec 19, 2016
180
64
103
Denmark
cPanel Access Level
Root Administrator
Does CPanel offer a automated backup that is an app or can be executed with a cron job that would backup the last week or month for a file? It would date it so you can find a particular file by date. I just want to backup one file that is created every day with a php script but this file gets overwritten each day by script.

Thanks
You can kind of already do that today with the cPanel Backup feature. You can set retention to whatever you require, enabling you to restore single files within that "range".
So if your backup retention is 1 month, you are able to restore files and folders back 1 month.
As cPanel Backup backs up whole accounts, I recommend using the incremental backup type.
 
  • Like
Reactions: cPRex