I have a webcam running with Motion.

It's all working fine, however, after a while it stops working.

This appears to be because it is filling up the /tmp/motion directory with jpegs. (Clearing out this directory and then restarting motion always brings it back up.)

I've set up a cron job to to delete old jpegs, but that feels like tackling the symptom and not the source of the problem, so I was wondering if there is a setting for it built into Motion.

Is there a way to prevent Motion from using up more than a set amount of disk space for this purpose?


You could also look at using streamer to send the images to a server or add a NAS mount point to save the images to.

The following link is a thread where a guy outlines how he achieved what I had suggested; using streamer to send the camera images to an external server. Send images to external server using streamer

  • Please elaborate on the link. It is not good style to give link answers. Apr 5 '13 at 17:26
  • "The following link is a thread where a guy describes how he used streamer" - That pretty much covers it. The guy outlines how achieved what I had suggested using streamer to send the camera images to an external server.
    – Zammalad
    Apr 5 '13 at 18:11
  • The issue with that, and the reason why it is discouraged is because links can change. Just add your comment to your answer, and it will be far better. In fact, I will do that for you. Apr 5 '13 at 18:12

I would think about creating new user and setting him some quota, eg. 2gb. This user will run motion in users specific directory but he could not use more than specific amount of disk space. The only think left to do would be to run some erase script after motion reach the size limit. It's not the direct solution, but as I can read the motion documentation there is no such functionality. The only think you can set up about size is the maximum length of the movie.


You can create another partition (ext4 filesystem) on the SD card specifically for that purpose, and mount it to /tmp/motion, or create symlink from /tmp/motion to the actual mount point.

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.