# Uploading backup -\> not enough space on disk

**URL:** <https://meta.discourse.org/t/uploading-backup-not-enough-space-on-disk/29217>\
**Category:** Product Support\
**Tags:** uploads, backups\
**Created:** [25.Май.2015 11:42:08 UTC](https://meta.discourse.org/t/uploading-backup-not-enough-space-on-disk/29217 "2015-05-25T11:42:08Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![michaeld](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/michaeld/32/1594_2.png) [@michaeld](https://meta.discourse.org/u/michaeld)\
**Post date:** [25.Май.2015 20:56:32 UTC](https://meta.discourse.org/t/uploading-backup-not-enough-space-on-disk/29217/3 "2015-05-25T20:56:32Z")

</div>

Try making a backup first on that VPS, then upload the existing one.

```
  def has_enough_space_on_disk?(size)
    `df -Pk #{Rails.root}/public/backups | awk 'NR==2 {print $4 * 1024;}'`.to_i > size
  end

```

This function fails when the `public/backups` directory does not exist (making a backup creates it).  
Maybe add another check?

---

_[View the full topic](https://meta.discourse.org/t/uploading-backup-not-enough-space-on-disk/29217)._
