Cron Job for deleting pictures from surveillance camera

Cron Job for deleting pictures from surveillance camera

Postby ewok11 » Thu Sep 12, 2013 8:19 pm

hi!

i am running a surveillance camera in my storage room in the basement. If it detects motion it sends a picture every second to the share "camera" on my Philips NAS (Firmware 14-0). It works really fine.

Now i tried to delete pictures older than 14 days by defining a cron job:

0 0 * * 1 find /share/1000/camera -mtime +14 -delete {} \;

This is what i found after some research on cron jobs. Unfortunately it does... nothing :-) I tried -delete, -rm and some other combinations. Does anybody have an idea how to get this job working?
ewok11
 
Posts: 1
Joined: Thu Oct 11, 2012 9:23 pm

Re: Cron Job for deleting pictures from surveillance camera

Postby fvdw » Thu Sep 12, 2013 8:30 pm

the reason could be that the subfolder were the pictures are stored and the files that are stored there are owned by root with only read permission for others

However cron jobs run with root permissions so it should be able to delete them without changing file permissions :scratch
Are you sure that they are in the folder /share/1000/camera and not in /share/1000/motion-webcam/camera ? (this is the normal setup)

Otherwise check the file and folder permissions, you can change them using the chmod command
fvdw
Site Admin - expert
 
Posts: 13245
Joined: Tue Apr 12, 2011 2:30 pm
Location: Netherlands

Re: Cron Job for deleting pictures from surveillance camera

Postby Jocko » Thu Sep 12, 2013 9:30 pm

Hi ewok11

Do you note that "0 0 * * 1" means : At each Monday, 00:00 ?

Note : I don't think it's a permission issue as crond is running with root privileges (like FVDW said)

Note2 : I think '{} \;' is useless. Check it directly by giving your command in Putty (it can be used with option -exec)
Jocko
Site Admin - expert
 
Posts: 11367
Joined: Tue Apr 12, 2011 4:48 pm
Location: Orleans, France


Return to Philips SPD8020

Who is online

Users browsing this forum: No registered users and 1 guest

cron