Take the 2-minute tour ×
Raspberry Pi Stack Exchange is a question and answer site for users and developers of hardware and software for Raspberry Pi. It's 100% free, no registration required.

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?

share|improve this question

3 Answers 3

up vote 2 down vote accepted

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

share|improve this answer
    
Please elaborate on the link. It is not good style to give link answers. –  xxmbabanexx 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. –  xxmbabanexx 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.

share|improve this answer

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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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