Closed
Bug 1315341
Opened 9 years ago
Closed 9 years ago
Automate the clean up Tableau daily backup files
Categories
(Infrastructure & Operations :: MOC: Service Requests, task)
Infrastructure & Operations
MOC: Service Requests
Tracking
(Not tracked)
RESOLVED
FIXED
People
(Reporter: josephine, Assigned: ryanc)
References
Details
Attachments
(1 file, 3 obsolete files)
|
1.59 KB,
text/plain
|
Details |
This bug is to track the work to automate the clean up Tableau daily backup files.
Requirements will be specified.
| Assignee | ||
Comment 1•9 years ago
|
||
(In reply to Josephine from comment #0)
> This bug is to track the work to automate the clean up Tableau daily backup
> files.
>
> Requirements will be specified.
Awaiting requirements (directories, files, etc that need to be purged daily).
Assignee: nobody → rchilds
Status: NEW → ASSIGNED
Comment 2•9 years ago
|
||
Location and other details can be found in bug 1314771:
"Currently there is a daily backup that runs in tableau server and the file is put in C:\TableauBackups.
At the end of the month, the daily files are so large and it's hitting the disk space available in the server. I have a monthly manual routine to remove all daily backup files and leave only one backup file for every month. Please let me know if there is a way to do this better."
I believe, now that bacula backups are configured, the idea is to delete all but the last few days of files except one, per month.
The result should be one file for every previous month plus the last 5 days.
See Also: → 1314771
| Reporter | ||
Comment 3•9 years ago
|
||
Thanks Peter, that sounds right.
At the end of the month, I usually leave only 1 backup file, which is the last day of the month. So leaving one per month plus the last 5 days is good.
rchilds, please let me know if you need anything else.
| Assignee | ||
Comment 4•9 years ago
|
||
That's everything I need to know - Rolling with that
| Assignee | ||
Comment 5•9 years ago
|
||
Here's an early draft with some sample output to test,
PS C:\Users\serverops-admin\Downloads> .\listfiledates1.ps1
10/31/2015 tableau2-scl3-backup-2015-10-31-23-00-08.tsbak
10/31/2015
10/31/2015 10/31/2015
Dates match
---
11/30/2015 tableau2-scl3-backup-2015-11-30-23-00-08.tsbak
11/30/2015
11/30/2015 11/30/2015
Dates match
---
12/31/2015 tableau2-scl3-backup-2015-12-31-23-00-08.tsbak
12/31/2015
12/31/2015 12/31/2015
Dates match
---
1/31/2016 tableau2-scl3-backup-2016-01-31-23-00-09.tsbak
1/31/2016
1/31/2016 1/31/2016
Dates match
---
2/29/2016 tableau2-scl3-backup-2016-02-29-23-00-07.tsbak
2/29/2016
2/29/2016 2/29/2016
Dates match
---
3/31/2016 tableau2-scl3-backup-2016-03-31-23-00-06.tsbak
3/31/2016
3/31/2016 3/31/2016
Dates match
---
4/30/2016 tableau2-scl3-backup-2016-04-30-23-00-08.tsbak
4/30/2016
4/30/2016 4/30/2016
Dates match
---
5/31/2016 tableau2-scl3-backup-2016-05-31-23-00-08.tsbak
5/31/2016
5/31/2016 5/31/2016
Dates match
---
6/30/2016 tableau2-scl3-backup-2016-06-30-23-00-07.tsbak
6/30/2016
6/30/2016 6/30/2016
Dates match
---
7/31/2016 tableau2-scl3-backup-2016-07-31-23-00-07.tsbak
7/31/2016
7/31/2016 7/31/2016
Dates match
---
8/31/2016 tableau2-scl3-backup-2016-08-31-23-00-07.tsbak
8/31/2016
8/31/2016 8/31/2016
Dates match
---
10/1/2016 tableau2-scl3-backup-2016-09-30-23-55-07.tsbak
10/31/2016
10/31/2016 10/1/2016
Dates don't match
---
10/31/2016 tableau2-scl3-backup-2016-10-30-23-55-07.tsbak
10/31/2016
10/31/2016 10/31/2016
Dates match
---
11/1/2016 tableau2-scl3-backup-2016-10-31-23-55-06.tsbak
11/30/2016
11/30/2016 11/1/2016
Dates don't match
---
11/6/2016 tableau2-scl3-backup-2016-11-05-23-55-06.tsbak
11/30/2016
11/30/2016 11/6/2016
Dates don't match
---
11/7/2016 tableau2-scl3-backup-2016-11-06-23-55-06.tsbak
11/30/2016
11/30/2016 11/7/2016
Dates don't match
---
| Reporter | ||
Comment 6•9 years ago
|
||
Ryanc, please let me know if you need me to action on anything from your test result above.
| Assignee | ||
Comment 7•9 years ago
|
||
(In reply to Josephine from comment #6)
> Ryanc, please let me know if you need me to action on anything from your
> test result above.
This needs just a bit more work and should get back around to this next week -- I will certainly let you know.
| Reporter | ||
Comment 8•9 years ago
|
||
Hi Ryan,
I'd like to remove some of the backup files because it's already eating up the disk space. Hope it's not affecting your test on your script. I do need to remove them and I'll do it EOD today.
| Assignee | ||
Comment 9•9 years ago
|
||
That's fine
| Assignee | ||
Comment 10•9 years ago
|
||
I initially wanted to do this in powershell, but looking at these systems it appears that they have python installed, so I went that route with this latest revision. Will polish and wrap this up next week.
tableau2-scl3-backup-2015-10-31-23-00-08.tsbak Monthly backup
tableau2-scl3-backup-2015-11-30-23-00-08.tsbak Monthly backup
tableau2-scl3-backup-2015-12-31-23-00-08.tsbak Monthly backup
tableau2-scl3-backup-2016-01-31-23-00-09.tsbak Monthly backup
tableau2-scl3-backup-2016-02-29-23-00-07.tsbak Monthly backup
tableau2-scl3-backup-2016-03-31-23-00-06.tsbak Monthly backup
tableau2-scl3-backup-2016-04-30-23-00-08.tsbak Monthly backup
tableau2-scl3-backup-2016-05-31-23-00-08.tsbak Monthly backup
tableau2-scl3-backup-2016-06-30-23-00-07.tsbak Monthly backup
tableau2-scl3-backup-2016-07-31-23-00-07.tsbak Monthly backup
tableau2-scl3-backup-2016-08-31-23-00-07.tsbak Monthly backup
tableau2-scl3-backup-2016-09-30-23-55-07.tsbak Monthly backup
tableau2-scl3-backup-2016-10-31-23-55-06.tsbak Monthly backup
tableau2-scl3-backup-2016-11-20-23-55-03.tsbak 4 days old
tableau2-scl3-backup-2016-11-21-23-55-03.tsbak 3 days old
tableau2-scl3-backup-2016-11-22-23-55-09.tsbak 2 days old
tableau2-scl3-backup-latest.tsbak 2 days old
['tableau2-scl3-backup-2016-11-15-23-55-07.tsbak', 'tableau2-scl3-backup-2016-11-16-23-55-03.tsbak', 'tableau2-scl3-backup-2016-11-17-23-55-08.tsbak', 'tableau2-scl3-backup-2016-11-18-23-55-03.tsbak', 'tableau2-scl3-backup-2016-11-19-23-55-03.tsbak']
Attachment #8810732 -
Attachment is obsolete: true
| Reporter | ||
Comment 11•9 years ago
|
||
Great news!
| Assignee | ||
Comment 12•9 years ago
|
||
(In reply to Josephine from comment #11)
> Great news!
Indeed -- Does there need to be any kind of log for when this runs?
Here's the script's current behavior in output, it'd just need to be changed to actually delete the backups. I'll include that final revision in my next comment,
tableau2-scl3-backup-2015-10-31-23-00-08.tsbak Monthly backup
tableau2-scl3-backup-2015-11-30-23-00-08.tsbak Monthly backup
tableau2-scl3-backup-2015-12-31-23-00-08.tsbak Monthly backup
tableau2-scl3-backup-2016-01-31-23-00-09.tsbak Monthly backup
tableau2-scl3-backup-2016-02-29-23-00-07.tsbak Monthly backup
tableau2-scl3-backup-2016-03-31-23-00-06.tsbak Monthly backup
tableau2-scl3-backup-2016-04-30-23-00-08.tsbak Monthly backup
tableau2-scl3-backup-2016-05-31-23-00-08.tsbak Monthly backup
tableau2-scl3-backup-2016-06-30-23-00-07.tsbak Monthly backup
tableau2-scl3-backup-2016-07-31-23-00-07.tsbak Monthly backup
tableau2-scl3-backup-2016-08-31-23-00-07.tsbak Monthly backup
tableau2-scl3-backup-2016-09-30-23-55-07.tsbak Monthly backup
tableau2-scl3-backup-2016-10-31-23-55-06.tsbak Monthly backup
tableau2-scl3-backup-2016-11-26-23-55-03.tsbak 5 days old
tableau2-scl3-backup-2016-11-27-23-55-03.tsbak 4 days old
tableau2-scl3-backup-2016-11-28-23-55-10.tsbak 3 days old
tableau2-scl3-backup-2016-11-29-23-55-03.tsbak 2 days old
tableau2-scl3-backup-2016-11-30-23-55-04.tsbak Monthly backup
---
backups to be deleted
tableau2-scl3-backup-2016-11-15-23-55-07.tsbak
tableau2-scl3-backup-2016-11-16-23-55-03.tsbak
tableau2-scl3-backup-2016-11-17-23-55-08.tsbak
tableau2-scl3-backup-2016-11-18-23-55-03.tsbak
tableau2-scl3-backup-2016-11-19-23-55-03.tsbak
tableau2-scl3-backup-2016-11-20-23-55-03.tsbak
tableau2-scl3-backup-2016-11-21-23-55-03.tsbak
tableau2-scl3-backup-2016-11-22-23-55-09.tsbak
tableau2-scl3-backup-2016-11-23-23-55-05.tsbak
tableau2-scl3-backup-2016-11-24-23-56-03.tsbak
tableau2-scl3-backup-2016-11-25-23-55-03.tsbak
| Reporter | ||
Comment 13•9 years ago
|
||
I think adding a log would be good in case there is an issue we do not anticipate.
Is there a way to know if bacula's backup successful or fail? The reason I asked is I would like the delete script you created to not run when bacula backup fails.
Also, we're moving tableau servers to VM. I would like to move this script to the new prod server (tableau6) when this is completed.
Will send an email out to MOC on the details of the tableau VMs.
Thanks,
Josephine
Comment 14•9 years ago
|
||
The reason I suggested keeping the last 5 days was just in case bacula fails for a day or two, it gives time for those files to get backed up.
:rtucker I assume you'd know if bacula fails on these hosts? Is there a notification or a way to tell on the host itself?
Flags: needinfo?(rtucker)
Comment 15•9 years ago
|
||
5 days is fine as well. I can configure bacula to send an email to whomever should backups fail.
Flags: needinfo?(rtucker)
| Assignee | ||
Comment 16•9 years ago
|
||
Alright,
Here's the third revision with logging, I'll get this reviewed in Hawaii and get it out for use soon after.
| Assignee | ||
Comment 17•9 years ago
|
||
Comment on attachment 8816732 [details]
tableau_backup_cleanup3
Keegan,
Let me know your thoughts on this script
Attachment #8816732 -
Flags: review?(kferrando)
Comment 18•9 years ago
|
||
Comment on attachment 8816732 [details]
tableau_backup_cleanup3
as per conversation, please manage the log file properly (rotate, etc)
Attachment #8816732 -
Flags: review?(kferrando) → review+
| Assignee | ||
Comment 19•9 years ago
|
||
Updated script to truncate log if it's over 1Mb.
Josephine gave me the go-ahead to test the script yesterday and it ran with expected behavior,
2016-12-09 19:26:28.024000
tableau2-scl3-backup-2015-10-31-23-00-08.tsbak monthly backup
tableau2-scl3-backup-2015-11-30-23-00-08.tsbak monthly backup
tableau2-scl3-backup-2015-12-31-23-00-08.tsbak monthly backup
tableau2-scl3-backup-2016-01-31-23-00-09.tsbak monthly backup
tableau2-scl3-backup-2016-02-29-23-00-07.tsbak monthly backup
tableau2-scl3-backup-2016-03-31-23-00-06.tsbak monthly backup
tableau2-scl3-backup-2016-04-30-23-00-08.tsbak monthly backup
tableau2-scl3-backup-2016-05-31-23-00-08.tsbak monthly backup
tableau2-scl3-backup-2016-06-30-23-00-07.tsbak monthly backup
tableau2-scl3-backup-2016-07-31-23-00-07.tsbak monthly backup
tableau2-scl3-backup-2016-08-31-23-00-07.tsbak monthly backup
tableau2-scl3-backup-2016-09-30-23-55-07.tsbak monthly backup
tableau2-scl3-backup-2016-10-31-23-55-06.tsbak monthly backup
tableau2-scl3-backup-2016-11-30-23-55-04.tsbak monthly backup
tableau2-scl3-backup-2016-12-04-23-55-06.tsbak 5 days old
tableau2-scl3-backup-2016-12-05-23-55-05.tsbak 4 days old
tableau2-scl3-backup-2016-12-06-23-55-04.tsbak 3 days old
tableau2-scl3-backup-2016-12-07-23-55-04.tsbak 2 days old
tableau2-scl3-backup-2016-12-08-23-55-05.tsbak 1 days old
---
backups to be deleted
tableau2-scl3-backup-2016-11-15-23-55-07.tsbak
tableau2-scl3-backup-2016-11-16-23-55-03.tsbak
tableau2-scl3-backup-2016-11-17-23-55-08.tsbak
tableau2-scl3-backup-2016-11-18-23-55-03.tsbak
tableau2-scl3-backup-2016-11-19-23-55-03.tsbak
tableau2-scl3-backup-2016-11-20-23-55-03.tsbak
tableau2-scl3-backup-2016-11-21-23-55-03.tsbak
tableau2-scl3-backup-2016-11-22-23-55-09.tsbak
tableau2-scl3-backup-2016-11-23-23-55-05.tsbak
tableau2-scl3-backup-2016-11-24-23-56-03.tsbak
tableau2-scl3-backup-2016-11-25-23-55-03.tsbak
tableau2-scl3-backup-2016-11-26-23-55-03.tsbak
tableau2-scl3-backup-2016-11-27-23-55-03.tsbak
tableau2-scl3-backup-2016-11-28-23-55-10.tsbak
tableau2-scl3-backup-2016-11-29-23-55-03.tsbak
tableau2-scl3-backup-2016-12-01-23-55-03.tsbak
tableau2-scl3-backup-2016-12-02-23-55-03.tsbak
tableau2-scl3-backup-2016-12-03-23-55-07.tsbak
2016-12-09 19:32:48.048000
tableau2-scl3-backup-2015-10-31-23-00-08.tsbak monthly backup
tableau2-scl3-backup-2015-11-30-23-00-08.tsbak monthly backup
tableau2-scl3-backup-2015-12-31-23-00-08.tsbak monthly backup
tableau2-scl3-backup-2016-01-31-23-00-09.tsbak monthly backup
tableau2-scl3-backup-2016-02-29-23-00-07.tsbak monthly backup
tableau2-scl3-backup-2016-03-31-23-00-06.tsbak monthly backup
tableau2-scl3-backup-2016-04-30-23-00-08.tsbak monthly backup
tableau2-scl3-backup-2016-05-31-23-00-08.tsbak monthly backup
tableau2-scl3-backup-2016-06-30-23-00-07.tsbak monthly backup
tableau2-scl3-backup-2016-07-31-23-00-07.tsbak monthly backup
tableau2-scl3-backup-2016-08-31-23-00-07.tsbak monthly backup
tableau2-scl3-backup-2016-09-30-23-55-07.tsbak monthly backup
tableau2-scl3-backup-2016-10-31-23-55-06.tsbak monthly backup
tableau2-scl3-backup-2016-11-30-23-55-04.tsbak monthly backup
tableau2-scl3-backup-2016-12-04-23-55-06.tsbak 5 days old
tableau2-scl3-backup-2016-12-05-23-55-05.tsbak 4 days old
tableau2-scl3-backup-2016-12-06-23-55-04.tsbak 3 days old
tableau2-scl3-backup-2016-12-07-23-55-04.tsbak 2 days old
tableau2-scl3-backup-2016-12-08-23-55-05.tsbak 1 days old
---
backups to be deleted
Moving forward this script should be ran daily at 1AM
Attachment #8814002 -
Attachment is obsolete: true
Attachment #8816732 -
Attachment is obsolete: true
| Assignee | ||
Comment 20•9 years ago
|
||
Calling this good - Feel free to reopen if anything further is needed
Ping me on IRC if you need assistance placing this script
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•