# Hourly backup, only if something has changed

**URL:** <https://meta.discourse.org/t/hourly-backup-only-if-something-has-changed/27274>\
**Category:** Feature\
**Tags:** backups\
**Created:** [April 6, 2015, 9:57pm UTC](https://meta.discourse.org/t/hourly-backup-only-if-something-has-changed/27274 "2015-04-06T21:57:56Z")\
**Posts on this page:** 1\
**Showing post:** 12

<div class="post-metadata">

**Author:** ![zogstrip](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/zogstrip/32/512781_2.png) [@zogstrip](https://meta.discourse.org/u/zogstrip)\
**Post date:** [April 7, 2015, 10:28pm UTC](https://meta.discourse.org/t/hourly-backup-only-if-something-has-changed/27274/12 "2015-04-07T22:28:46Z")

</div>

> [@frederic](#):
>
> Is there any Discourse API that I can request to know if something in the content has changed during a lapse of time ? INSERT/UPDATE/DELETE of a post or a file should be enough.

You could check whether a post/topic/user was created/updated in the last hour. Something like this

```ruby
def has_something_changed_since?(date=1.hour.ago)
  [User, Post, Topic].any? { |klass| klass.exists?("created_at >= :date OR updated_at >= :date", date: date) }
end

```

---

_[View the full topic](https://meta.discourse.org/t/hourly-backup-only-if-something-has-changed/27274)._
