Bacula - Remove /var/lib/pgsql/db-backup/* on rhnsat1.dmz.scl3 after backup

RESOLVED FIXED

Status

--
enhancement
RESOLVED FIXED
2 years ago
a year ago

People

(Reporter: Usul, Assigned: rtucker)

Tracking

Details

Attachments

(1 attachment)

(Reporter)

Description

2 years ago
Thu 10:35:55 UTC [5039] [moc] rhnsat1.dmz.scl3.mozilla.com:Disk - All is WARNING: DISK WARNING - free space: / 3479 MB (10% inode=94%): (http://m.mozilla.org/Disk+-+All)

This alerted after I patched and backedup the db, backups are 2,1 GB heavy.
[root@rhnsat1.dmz.scl3 db-backups]# ls -lhtr
total 4,1G
-rw-r--r-- 1 postgres root 2,0G 27 avril 01:27 042717
-rw-r--r-- 1 postgres root 2,1G  1 juin  10:26 backup010617

Maybe we should clean this path on a monthly basis ?

fixed the alarm by removing the older backup
Sure
Assignee: nobody → rchilds
Severity: normal → enhancement
Status: NEW → ASSIGNED
Created attachment 8877015 [details] [diff] [review]
satellite-cron1

Here's a cron to delete everything in the backup directory at the beginning of each month.
Attachment #8877015 - Flags: review?(ashish)
Summary: cron a job to clean up the /root/backup directory → cron a job to clean up /root/backup on rhnsat1.dmz.scl3
Comment on attachment 8877015 [details] [diff] [review]
satellite-cron1

r+ but what is this backup? Does this go into bacula? If so, bacula-client can rm files after the backup job completes...
Attachment #8877015 - Flags: review?(ashish) → review+
(In reply to Ashish Vijayaram [:ashish] from comment #3)
> Comment on attachment 8877015 [details] [diff] [review]
> satellite-cron1
> 
> r+ but what is this backup? Does this go into bacula? If so, bacula-client
> can rm files after the backup job completes...

This is a backup of the postgres db that the satellite relies upon. It would be nice if Bacula could do this.
Adding :rtucker - can we have bacula-client remove /root/backup/* on rhnsat1.dmz.scl3 after it finishes the backup?
Tossing to that component to wrap up -- Thanks
Assignee: rchilds → infra
Status: ASSIGNED → NEW
Component: MOC: Problems → Infrastructure: Backups
QA Contact: lypulong → rtucker
Summary: cron a job to clean up /root/backup on rhnsat1.dmz.scl3 → Bacula - Remove /root/backup/* on rhnsat1.dmz.scl3 after backup
See Also: → bug 1375791
(Assignee)

Comment 7

a year ago
I just checked and there is no /root/backup/ on rhnsat1.dmz.scl3

Is there a different directory to remove?
(In reply to Rob Tucker [:rtucker] from comment #7)
> I just checked and there is no /root/backup/ on rhnsat1.dmz.scl3
> 
> Is there a different directory to remove?

[rchilds@rhnsat1.dmz.scl3 ~]$ sudo ls -alh /var/lib/pgsql/db-backup
total 2.1G
drwxr-xr-x 2 postgres postgres 4.0K Aug 15 00:06 .
drwx------ 3 postgres postgres 4.0K May 22 14:48 ..
-rw-r--r-- 1 postgres root     2.1G Aug 15 00:26 081417-1
(Assignee)

Comment 9

a year ago
(In reply to Ryan C [:ryanc] from comment #8)
> (In reply to Rob Tucker [:rtucker] from comment #7)
> > I just checked and there is no /root/backup/ on rhnsat1.dmz.scl3
> > 
> > Is there a different directory to remove?
> 
> [rchilds@rhnsat1.dmz.scl3 ~]$ sudo ls -alh /var/lib/pgsql/db-backup
> total 2.1G
> drwxr-xr-x 2 postgres postgres 4.0K Aug 15 00:06 .
> drwx------ 3 postgres postgres 4.0K May 22 14:48 ..
> -rw-r--r-- 1 postgres root     2.1G Aug 15 00:26 081417-1

Are you saying to rm -rf /var/lib/pgsql/db-backup/* even though nothing has been written there since August 15?
Rob,

We manually patch this system and when we do, we create a backup during that time. I think the goal here is for bacula to retrieve whatever backup file exists at the time and delete it from the local disk. Thanks
(Assignee)

Comment 11

a year ago
(In reply to Ryan C [:ryanc] from comment #10)
> Rob,
> 
> We manually patch this system and when we do, we create a backup during that
> time. I think the goal here is for bacula to retrieve whatever backup file
> exists at the time and delete it from the local disk. Thanks

So to remove all levels of ambiguity:

This bug should be "Bacula - Remove /var/lib/pgsql/db-backup/* on rhnsat1.dmz.scl3 after backup"

We're currently backing up all of /var. The files backed up from /var/lib/pgsql/db-backup/* will persist for 180 days in bacula once the file has been removed from local disk on rhnsat1.dmz.scl3.mozilla.com.
(Assignee)

Comment 12

a year ago
I've added the following Runscript to the backup job for rhnsat1.dmz.scl3.mozilla.com:
  Runscript {
   Command = "/bin/find /var/lib/pgsql/db-backup -type f -exec rm {} \;"
   RunsOnClient = yes
   RunsWhen = After
  }

I've ran the job manually and confirmed the removal of /var/lib/pgsql/db-backup/081417-1

The file can be found when backed up by job 239044


If there is anything else to be done here, please comment and reopen.
Assignee: infra → rtucker
Summary: Bacula - Remove /root/backup/* on rhnsat1.dmz.scl3 after backup → Bacula - Remove /var/lib/pgsql/db-backup/* on rhnsat1.dmz.scl3 after backup
(Assignee)

Updated

a year ago
Status: NEW → RESOLVED
Last Resolved: a year ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.