Need app to automatically delete certain files when space is low.

Discussion in 'Mac Apps and Mac App Store' started by OCDMacGeek, Dec 2, 2010.

  1. OCDMacGeek macrumors 6502a


    Jul 19, 2007
    I have a smaller SSD drive in my Mac Pro. I have other disks, but I like the small SSD as my main drive. I have a program (Daylite) that needs to backup its database every day. The program refuses to save these backups anywhere except the main drive. Therefore, my SSD fills up quickly and when I forget the delete old backups, my drive gets full and the system stops.

    I need to be able to automatically delete older files from that folder when my drive is getting full. For instance, I could have any files older than 3 days be deleted from that folder whenever the disk is low.

    Anyone know of an app for this?

  2. Mal macrumors 603


    Jan 6, 2002
    You could possibly do that with a folder action, using Automator.

  3. MisterMe macrumors G4


    Jul 17, 2002
    This is so wrong on so many levels:
    1. You should not use your main drive as a backup. All you are doing is duplicating your files.
    2. You should not hold you needs hostage to your software. If Daylite only allows you to backup to your main drive, then replace it with software that allows you to do real backups. Carbon Copy Cloner is free.
    3. You want to automatically delete files when capacity is low? Huh?!! The purpose of backup software is to save your data, not delete it. You inadvertently delete a primary critical file four days after backup and one day after your backup has been deleted. Where are you then?
    There are many backup/synchronize utilities available for the Mac. In virtually every case, you will do better than you are doing now.
  4. angelwatt Moderator emeritus


    Aug 16, 2005
    It could be done with a bash script using the find command making use of the ctime (or maybe mtime or atime ; c=created, m=modified, a=accessed-last). I use the command for finding recently modified/created files. Once you had the script it could be run automatically via cron. The trick will be writing the bash script, which could potentially be a single line command. I can't give a solution off-hand because there's too many unknowns about the exact setup. You can likely find a solution on-line though.

    Example usage:
    Find all files modified in last minute starting from the current directory (given as .).
    find . -mtime -1m
    Same, but will delete everything it finds. I don't recommend running this casually. Use the above first to make sure it doesn't find anything you don't want deleted.
    find . -mtime -1m -delete
    Find items created more than 1 year ago.
    find . -ctime +365d
  5. otherorange macrumors newbie

    Apr 24, 2007
    Wouldn't that run the risk of deleting important files, like system files, etc. That seems EXTREMELY risky to me.

    Why not just use Time Machine or some other back-up software. Anything that backs up your entire hard drive will back-up the Daylite database as well. And these solutions automatically delete older files when the space is needed.

    However, according to the Daylite website you can specify a different location for the backup however so this should all be unnecessary.
  6. OCDMacGeek thread starter macrumors 6502a


    Jul 19, 2007
    Some of these responses haven't really been on point. Daylite isn't backup software. It's a project database program, and it has a built in backup solution to make backups of its Postgres-based database. Time machine backups dont work for whatever reason, as the developer takes great pains to note. While the software is supposed to let one choose where to place backup files, it has never worked. Anytime I select a folder on anything except my main drive I get an error.

    I don't know how to use Automator, unfortunately. Just had a new baby boy on Monday, no time to learn!

    This wouldn't be very risky as I'm planning it, because I would keep several days on backups. I would only automatically delete obsolete backups that are a week old.

    Any ideas that could help?
  7. Intell macrumors P6


    Jan 24, 2010
    Try Hazel. It works pretty well and is customizable.
  8. Oakbridge macrumors newbie

    Dec 3, 2010
    You can choose an external drive to backup your database. I have this on my own setup and it has worked flawlessly. If you're getting an error message, it could be that the location you are selecting is not accessible by the Daylite user on your machine. Check permissions.

    Your comment about not being able to use Time Machine is incorrect but it is a common misconception. I'll explain. Because your Daylite database file is considered to be an 'open file' you cannot use Time Machine to back that file up directly.

    However you can and should use Time Machine to backup your Daylite database BACKUPS.

    As mentioned by another post, Hazel is a popular tool for deleting older Daylite Backup files.
  9. OCDMacGeek thread starter macrumors 6502a


    Jul 19, 2007
    Thanks Steve and other posters, I appreciate it. I must have some permissions issues, but Hazel works like a charm.

Share This Page