Thanks Craig, for the swift reply.  The steps you outlined worked!  I
will document this in the wiki under
https://github.com/backuppc/backuppc/wiki/Fix-a-corrupted-backups-file 

One last question: After the backups file was corrupted, I got a new
backup numbered #0.
In the UI, this backup is now displayed at the bottom of backup lists,
i.e. "Backup Summary". 

I can think of 2 options: 

a) Remove #0 and just re-create the backup
b) mv pc/hostName/0 pc/hostName/$nextID and re-run
BackupPC_fixupBackupSummary hostName 

Which way would you recommend? 

Thanks,
Raoul 

FYI: As you recognized, I used $host to obfuscate the real host name in
my email. 

On 2020-08-14 00:57, Craig Barratt via BackupPC-users wrote:

> Raoul, 
> 
> Thanks for maintaining the Debian packages!
> 
> I'm not sure how the backups files got corrupted. 
> 
> First, do you really have a host called $host, or are you just obfuscating 
> the real host name?  The reason I ask if there is this line in the LOG file: 
> 
>> Added host $host to backup list
> 
> When you did this, I assume $host is replaced by your shell; is that correct? 
> 
>> ls -altr pc/$host
> 
> Anyhow, you can recover the backups file using BackupPC_fixupBackupSummary.  
> As the BackupPC user, run it with the host name argument(s) you want to fix: 
> 
>> BackupPC_fixupBackupSummary hostName
> 
> Just to be safe, you should save away the current backups file for that host, 
> eg: 
> 
>> cp pc/hostName/backups pc/hostName/backups.save
> Yes, as you mentioned, I'd recommend not running BackupPC until it looks like 
> the backups files are correct and the overall the cpool and pc directories 
> look complete, with correct permissions.  You could run test command like 
> BackupPC_tarCreate to see that the backups can be accessed correctly. 
> 
> Craig
> 
> On Thu, Aug 13, 2020 at 5:41 AM Raoul Bhatia <ra...@bhatia.at> wrote: 
> 
>> Dear community, 
>> 
>> I am more or less lurking on this mailing list. I am also trying to maintain 
>> unofficial BackupPC Debian packages, see 
>> https://github.com/backuppc/backuppc/wiki/Build-Your-Own-Packages 
>> 
>> First off: How do I prevent nightly cleanups to mess with the data in the 
>> pool?  I currently have stopped the BackupPC process.
>> 
>> Yesterday, I performed maintenance work on my backup server incl. building 
>> 4.4.0 Debian packages, upgrading my own server & rebooting the system. 
>> 
>> I now have one host where the old backups vanished from the UI i.e. #0 
>> (Full) is the current backup.
>> However, in the filesystem I see all the old backups in 
>> $Conf{TopDir}/pc/$host/: 
>> 
>> find pc/$host/ -maxdepth 1 -type d | wc -l
>> 103 
>> 
>> After upgrading BackupPC & before rebooting, I tested my new package by 
>> trying to do Incremental backups of said host.
>> FYI: I had an issue with missing +x flags on the binaries (my own 
>> wrong-doing) and thus I had to upgrade the package & initiate the backup a 
>> couple of times.
>> Last but not least, there is a small chance that I rebooted at an 
>> inconvenient time, i.e. during some house keeping? 
>> 
>> Any help would be appreciated.  Also, how do I prevent nightly cleanups to 
>> mess with the data in the pool? 
>> 
>> Debug information (times are in CEST) 
>> 
>> Log files excerpt: 
>> 
>> # last reboot
>> reboot   system boot  4.15.0-112-gener Wed Aug 12 23:58   still running
>> reboot   system boot  4.15.0-112-gener Tue Aug 11 22:28 - 23:52 (1+01:24)
>> 
>> # ls -altr pc/$host/
>> [...]
>> drwxr-x--- 1 backuppc backuppc    396 Aug  3 07:26 5503
>> -rw-r----- 1 backuppc backuppc   4050 Aug  3 07:37 XferLOG.5503.z
>> drwxr-x--- 1 backuppc backuppc    568 Aug 12 00:44 5504
>> -rw-r----- 1 backuppc backuppc  14460 Aug 12 00:59 XferLOG.5504.z
>> -rw-r----- 1 backuppc backuppc      0 Aug 12 23:34 XferLOG.5505.z
>> drwxr-x--- 1 backuppc backuppc    568 Aug 12 23:47 5505
>> drwxr-xr-x 1 backuppc backuppc    226 Aug 13 00:01 ..
>> -rw-r----- 1 backuppc backuppc     65 Aug 13 02:21 backups.old
>> drwxr-x--- 1 backuppc backuppc    568 Aug 13 09:37 0
>> -rw-r----- 1 backuppc backuppc    125 Aug 13 09:37 backups
>> drwxr-x--- 1 backuppc backuppc   3998 Aug 13 09:37 .
>> drwxr-x--- 1 backuppc backuppc   3080 Aug 13 09:43 refCnt
>> -rw-r----- 1 backuppc backuppc 745080 Aug 13 09:43 XferLOG.0.z
>> -rw-r----- 1 backuppc backuppc   9479 Aug 13 13:00 LOG.082020
>> -rw-r----- 1 backuppc backuppc      0 Aug 13 13:14 LOCK 
>> 
>> # cat pc/$host/backups.old
>> 0       active  1597273203                                                   
>>                                            3                       0         
>>       1       rsync   0   4.4.0    58824   0
>> 
>> # cat pc/$host/backups
>> 0       full    1597273203      1597304229      66263   231293732766    904  
>>    29562   43      30377251        0       0       0       0       3       
>> 35321   4433611 0           1
>> rsync   0               4.4.0   139720  0 
>> 
>> LOG.0.z 
>> 
>> 2020-08-12 22:46:23 Got signal TERM... cleaning up (exit code = 0)
>> 2020-08-12 23:10:57 Reading hosts file
>> 2020-08-12 23:10:57 BackupPC 4.4.0 (Perl v5.26.1) started, pid 10828
>> 2020-08-12 23:10:57 Next wakeup is 2020-08-13 01:00:00
>> 2020-08-12 23:17:55 User backuppc requested backup of $host ($host)
>> 2020-08-12 23:17:55 can't exec BackupPC_dump for $host
>> 2020-08-12 23:26:35 Got signal TERM... cleaning up (exit code = 0)
>> 2020-08-12 23:26:36 Reading hosts file
>> 2020-08-12 23:26:36 BackupPC 4.4.0 (Perl v5.26.1) started, pid 11605
>> 2020-08-12 23:26:36 Next wakeup is 2020-08-13 01:00:00
>> 2020-08-12 23:58:30 Reading hosts file
>> 2020-08-12 23:58:30 Added host abc to backup list
>> 2020-08-12 23:58:30 Added host def to backup list
>> 2020-08-12 23:58:30 Added host ghi to backup list
>> 2020-08-12 23:58:30 Added host jkl to backup list
>> 2020-08-12 23:58:30 Added host mno to backup list
>> 2020-08-12 23:58:30 Added host $host to backup list
>> 2020-08-12 23:58:30 Added host pqr to backup list
>> 2020-08-12 23:58:30 Added host stu to backup list
>> 2020-08-12 23:58:30 BackupPC 4.4.0 (Perl v5.26.1) started, pid 1080
>> 2020-08-12 23:58:30 Next wakeup is 2020-08-13 01:00:00
>> 2020-08-12 23:59:59 Got signal TERM... cleaning up (exit code = 0)
>> 2020-08-13 00:00:02 Reading hosts file
>> 2020-08-13 00:00:02 BackupPC 4.4.0 (Perl v5.26.1) started, pid 3265
>> 2020-08-13 00:00:02 Next wakeup is 2020-08-13 01:00:00
>> 2020-08-13 00:00:34 Got signal TERM... cleaning up (exit code = 0)
>> 2020-08-13 00:00:36 Reading hosts file
>> 2020-08-13 00:00:36 BackupPC 4.4.0 (Perl v5.26.1) started, pid 3620
>> 2020-08-13 00:00:36 Next wakeup is 2020-08-13 01:00:00
>> 2020-08-13 00:01:47 Got signal TERM... cleaning up (exit code = 0)
>> 2020-08-13 00:01:48 Reading hosts file
>> 2020-08-13 00:01:48 BackupPC 4.4.0 (Perl v5.26.1) started, pid 3939
>> 2020-08-13 00:01:48 Next wakeup is 2020-08-13 01:00:00
>> 2020-08-13 00:02:07 User backuppc requested backup of abc (abc)
>> 2020-08-13 00:02:54 User backuppc requested backup of def (def)
>> [...]
>> 2020-08-13 00:07:59 Finished incr backup on abc
>> 2020-08-13 00:38:22 Finished incr backup on def
>> 2020-08-13 01:00:00 24hr disk usage: 87% max, 87% recent; inode: 0% max, 0% 
>> recent;  0 skipped hosts
>> 2020-08-13 01:00:01 Removing /data/backup/backuppc/log/LOG.13.z
>> 2020-08-13 01:00:01 Aging LOG files, LOG -> LOG.0 -> LOG.1 -> ... -> LOG.13
>> [...]
>> 
>> LOG: 
>> 
>> 2020-08-13 01:00:02 Running 2 BackupPC_nightly jobs from 0..15 (out of 0..15)
>> 2020-08-13 01:00:02 Running BackupPC_nightly -m -P 0 0 127 (pid=25442)
>> 2020-08-13 01:00:02 Running BackupPC_nightly -P 0 128 255 (pid=25443)
>> 2020-08-13 01:00:02 Next wakeup is 2020-08-13 02:00:00
>> 2020-08-13 01:00:03 Started full backup on $host (pid=25448, share=/etc/)
>> 2020-08-13 01:00:04 BackupPC_nightly now running BackupPC_refCountUpdate -m 
>> -s -c -P 0 -r 128-255
>> 2020-08-13 01:00:05 BackupPC_nightly now running BackupPC_refCountUpdate -m 
>> -s -c -P 0 -r 0-127
>> 2020-08-13 01:00:05  admin1 : __bpc_pidStart__ 25463
>> 2020-08-13 01:00:05  admin : __bpc_pidStart__ 25464
>> [...]
>> 2020-08-13 05:38:40  admin : __bpc_pidEnd__ 25464
>> 2020-08-13 05:38:40 BackupPC_nightly now running BackupPC_sendEmail
>> 2020-08-13 05:38:48 Finished  admin  (BackupPC_nightly -m -P 0 0 127)
>> 2020-08-13 05:38:48 Pool nightly clean removed 0 files of size 0.00GB
>> 2020-08-13 05:38:48 Pool is 0.00GB, 0 files (0 repeated, 0 max chain, 0 max 
>> links), 1 directories
>> 2020-08-13 05:38:48 Cpool nightly clean removed 0 files of size 0.00GB
>> 2020-08-13 05:38:48 Cpool is 0.00GB, 0 files (0 repeated, 0 max chain, 0 max 
>> links), 4369 directories
>> 2020-08-13 05:38:48 Pool4 nightly clean removed 0 files of size 0.00GB
>> 2020-08-13 05:38:48 Pool4 is 0.00GB, 0 files (0 repeated, 0 max chain, 0 max 
>> links), 0 directories
>> 2020-08-13 05:38:48 Cpool4 nightly clean removed 10809 files of size 1.26GB
>> 2020-08-13 05:38:48 Cpool4 is 77.44GB, 3423221 files (0 repeated, 0 max 
>> chain, 867859 max links), 16512 directories
>> 2020-08-13 05:38:48 Running BackupPC_rrdUpdate (pid=3281)
>> 2020-08-13 05:38:52  admin-1 : RRD updated: date 1597363200; cpoolKb 
>> 0.000000; total 124753421972.596680; poolKb 0.000000; pool4Kb 0.000000; 
>> cpool4Kb 79302004.000000
>> 2020-08-13 05:38:55 Finished  admin-1  (BackupPC_rrdUpdate)
>> [...]
>> 2020-08-13 09:43:12 Finished full backup on $host
>> [...]

-- 
DI (FH) Raoul Bhatia MSc
E-Mail. ra...@bhatia.at
Tel. +43 699 10132530
_______________________________________________
BackupPC-users mailing list
BackupPC-users@lists.sourceforge.net
List:    https://lists.sourceforge.net/lists/listinfo/backuppc-users
Wiki:    https://github.com/backuppc/backuppc/wiki
Project: https://backuppc.github.io/backuppc/

Reply via email to