WebFaction
Community site: login faq

I followed the instructions here: http://docs.webfaction.com/user-guide/databases.html#backing-up-a-database-automatically

However, this would require me to manually delete old backups. I think a reasonable approach for me would be to keep the last 5 days copies. So, when doing the next backup if I could automatically delete the oldest one in the directory I think that would work. Any idea how to accomplish this approach?

asked 05 Feb '14, 12:58

rsp
141612
accept rate: 0%


I run a daily cron job to remove backups older than a certain value:

0 0 * * * find /path/to/backups/* -mtime +30 -exec rm {} \;

Each day this removes all database backups over 30 days old. I take two backups per week leaving me with around 9 backups from the last 30 days at any given time.

permanent link

answered 05 Feb '14, 22:51

HittingSmoke
4822230
accept rate: 8%

You could use logrotate to only keep the number of backups you want. Please take a look at this post

permanent link

answered 05 Feb '14, 15:12

bmeyer71 ♦♦
1.5k3613
accept rate: 33%

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×168
×84
×36

question asked: 05 Feb '14, 12:58

question was seen: 3,088 times

last updated: 05 Feb '14, 22:51

WEBFACTION
REACH US
SUPPORT
AFFILIATE PROGRAM
LEGAL
© COPYRIGHT 2003-2019 SWARMA LIMITED - WEBFACTION IS A SERVICE OF SWARMA LIMITED
REGISTERED IN ENGLAND AND WALES 5729350 - VAT REGISTRATION NUMBER 877397162
5TH FLOOR, THE OLD VINYL FACTORY, HAYES, UB3 1HA, UNITED KINGDOM