Skip navigation

automatic file removal after 5 days

229 Views 4 Replies Latest reply: Apr 30, 2013 7:16 AM by helicopter RSS
helicopter Calculating status...
Currently Being Moderated
Apr 21, 2013 2:08 PM

I am running Mountain Lyon with os x server.  I am having camera files sent to my server from security cameras. I'd like to do the following

 

     *  turn on anonymous ftp

     *  limit how many files anonymous ftp can put on server - don't want to fill the hard drive with "stuff".  I would like an anonymous or user that can not log in directly to the mac.... I did notice that I can restrict a local user (one that can log into the desktop)

     *  after 5 days (or X number of days) have those security pictures deleted. 

 

thank you for looking at this, and for any and all help you all send my way.

OS X Mountain Lion (10.8.3), Mini
  • UptimeJeff Level 4 Level 4 (3,390 points)
    Currently Being Moderated
    Apr 21, 2013 7:21 PM (in response to helicopter)

    I'll leave the FTP part to you..

     

    the auto-delete is something I deal with all the time.

     

    To test (assumes extension of avi and 5 day purge)

    sudo find /path -name "*avi" -mtime +5 -exec echo rm {} \;

     

    If results look OK, drop the echo

    sudo find /path -name "*avi" -mtime +5 -exec rm {} \;

     

    As far as automating this.. Some would use launchd, and it may be the best option.

    I'm a bit old-school and would use crontab, if I wanted this to run every night at 2:00am

    edit /etc/crontab

     

    0 2 * * * root  find /path -name "*avi" -mtime +5 -exec rm {} \;

     

     

    this was just an example.. you may have to adjust to suit you environment

     

    Jeff

  • UptimeJeff Level 4 Level 4 (3,390 points)
    Currently Being Moderated
    Apr 22, 2013 10:18 AM (in response to helicopter)

    Glad to assisst :-)

Actions

More Like This

  • Retrieving data ...

Bookmarked By (0)

Legend

  • This solved my question - 10 points
  • This helped me - 5 points
This site contains user submitted content, comments and opinions and is for informational purposes only. Apple disclaims any and all liability for the acts, omissions and conduct of any third parties in connection with or related to your use of the site. All postings and use of the content on this site are subject to the Apple Support Communities Terms of Use.