I'm using rsync to backup two folders to the same target disk in a nightly cron-job:

rsync -avz /very/important/data /Backup/VID/
rsync -avz /other/stuff /Backup/tmp/

The first job backups more important data than the second one (e.g. mailbox vs movie collection), so i want to make sure that this job succeeds. Also the first job has a way smaller data volume than the first one.

Now I'm facing problems when the disk gets full:

  • Monday night: the first job succeeds, but the second one fills up the disk and eventually stops with a "disk full" message. That's OK (kindof).
  • Tuesday night: since the backup disk is still full from the previous night, this time already the first job fails. Now this is bad.

So I was wondering how to limit the available (destination) disk space of the second rsync job: if I could tell the second job that there was (say) 3GB less space available, it would exit earlier and leave space for the important job next day.

A first idea would be to create a large temporary file on the backup disk (after the first job has finished, before the second one started), and delete that file after the second job has finished (and before the next round).

Now I would like to avoid this, as the backup disk is really an NFS-mount and creating GB of dummy files on that device just for the sake of keeping space free is rather slow.

client system:

  • Debian/GNU linux 8.2 (jessie)
  • nfs-utils 1:1.2.8-9
  • kernel 3.16.0-4-amd64

I don't have access to the NFS-server.


Since you mention using nfs, I think using nfs quotas might be the easiest solutuion.

edit your /etc/fstab to limit the size for the non-important-data mount points like so:

<server>:</remote/export> /BACKUP/other/mnt auto rw,noauto,user,usrquota 0 0 Key is to add the usrquota bit to the mount options

And follow the guide here: https://en.wikibooks.org/wiki/LPI_Linux_Certification/Managing_Disk_Quota

There are a many guides on how to do this if this short intro isn't enough. https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/3/html/System_Administration_Guide/ch-disk-quotas.html

| improve this answer | |
  • my mount.nfs doesn't recognize the usrquota option (I'vve updated the question to include system specifics). – umläute Nov 26 '15 at 12:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.