The Omni Group Forums

The Omni Group Forums (http://forums.omnigroup.com/index.php)
-   OmniFocus 1 for Mac (http://forums.omnigroup.com/forumdisplay.php?f=38)
-   -   Backup Cleanup (http://forums.omnigroup.com/showthread.php?t=6939)

gryphonent 2008-01-26 06:49 AM

Backup Cleanup
 
I've written to you about this during the Beta... no reply, no implementation in the app. So, here we go again: OmniFocus should only keep a number of backups. My backup folder is too large by now and I'm sick and tired of having to clean it out myself. Please provide a preference for the user to decide how many backups to keep and let OmniFocus delete the older ones upon quit.

pvonk 2008-01-26 06:59 AM

I'll second that - I just checked my backup folder and found countless backups. I suppose an automator task could be written to delete the files periodically.

BwanaZulia 2008-01-26 08:18 AM

How about setting up a repeating action to clean up the backup folder in OmniFocus. :0

BZ

Toadling 2008-01-26 08:44 AM

I use [URL="http://www.noodlesoft.com/hazel.php"]Hazel[/URL] to clean up my backups. It works quite well and is handy for other things as well.

Still, some kind of preference in OF would be nice.

ptone 2008-01-26 01:19 PM

Here is a quick script, if your backups are not stored in the standard location, or you want to keep more than 15 days worth of backups, change accordingly.

[CODE]tell application "Finder"
set OFBackup to ((path to (documents folder) as string) & "OmniFocus Backups:") as alias
delete (every item of OFBackup whose creation date is less than ((current date) - (15 * days)))
end tell[/CODE]

Or for those that want to one line of shell script:

[CODE]find ~/Documents/OmniFocus\ Backups -type d -name "*.ofocus" -mtime +15 -print0 | xargs -0 rm -r[/CODE]

You could add that one line to your /etc/daily.local file and it will run nightly.

(or create your own cron entry)

-P

Dogsbreath 2008-02-02 03:47 AM

@ptone

I came over from the dark side a couple of years ago (Windoze), but have never got into scripts. I have no-one here to learn from either - the joys of living on a small island.

To use your script in an automated way would I add it as a Folder Action to the OF Backups folder?

Thanks

Andy

ptone 2008-02-02 09:46 AM

Andy,

The easiest route would be to just use a program that helps you automate things, like the above mentioned Hazel. Or a free alternative:
[url]http://www.tomhancocks.com/?p=63[/url]

Next on the ease of use ladder would be to take the Applescript snippet above and build it into an automator action.

You could save the snippet as a script in script editor and add it to the OF toolbar (see the extras forum for more info on how that can be done)

Finally the Unix command can be added to a file that the computer will run every night at midnight. located in /etc/daily.local

None of the above options are explained enough to follow as a step by step set of instructions, but depending on how much you want to learn, you can pick from top to bottom ;)

Good luck - there are lots of resources out there for learning about Applescript and shell scripting.

-P

gryphonent 2008-02-03 04:14 AM

Folks,

All your suggestions on how to solve the mess OmniFocus leaves behind are welcome. However, I don't intend to buy another app nor become proficient in AppleScript (which after 20 years of running Macs I never got into). There're apps out there that provide an option on how many backups are kept... why not OmniFocus? C'mon guys... it can't be that difficult to implement such feature.

Dogsbreath 2008-02-03 08:05 AM

Thanks ptone. I started looking at attaching the script to a folder action and it didn't work. I have downloaded some more information on folder actions so I will have a look at that as I have piqued an interest and then work through your list.

@gryphonet - I am sure that this will be on the development teams list of To Dos. If not it should be!!

Thanks again.

Andy

Dogsbreath 2008-02-03 12:05 PM

I went with Hazel in the end as File Action doesn't look for file dates etc.

Hazel has turned out to be an excellent purchase - so good that I got the family version.


All times are GMT -8. The time now is 09:17 PM.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2024, vBulletin Solutions, Inc.