Realizing that I should have done this long ago, I went ahead and made a launchd job to backup my main OW workspace daily. It seems particularly a good idea when running the sneaky peeks.
First make a folder called "Backups" in ~/Library/Application Support/OmniWeb 5/Workspaces.
Make a script in that folder; I called it backup.sh. Just paste this into your favorite text editor. After saving the text file, do chmod +x to it in the terminal to make it executable.
"Reading.owworkspace" is the name of the workspace that I'm backing up; more can be added.
The script will produce backups dated like this: Reading-2006.05.02.owworkspace
(Incidentally, one could also automate the backing up of URLs into a database by gunzipping the workspaces and extracting the URLs from the xml.)
Then make a new launchd entry, and put it in ~/Library/LaunchAgents. (Make the folder if it's not already.) Again, just another text file. Replace "USER" with your username. The backup time here is set to 5:55 am.
In order to make it backup more than once a day, you need to make a new launchd entry; that is, a new file and a new label (instead of USER.OWworkspacebackup, say, USER.OWworkspacebackup.1 and USER.OWworkspacebackup.2). If you do this, you need to change the above script to add the time to the backups' filenames (`date "+%Y.%m.%d.%H.%m"; see man strftime for other date-time options).
(The path to the script here has to be the full path, so no ~/Library/...; note that spaces and other normally escaped characters do not need to be escaped here.)
(Why is it that the [code] tag leaves so much space after the text?)
Lastly, to activate it, do launchctl load on the launchd file in the terminal.
I hope somebody finds this useful; if you have any questions, let me know.
First make a folder called "Backups" in ~/Library/Application Support/OmniWeb 5/Workspaces.
Make a script in that folder; I called it backup.sh. Just paste this into your favorite text editor. After saving the text file, do chmod +x to it in the terminal to make it executable.
"Reading.owworkspace" is the name of the workspace that I'm backing up; more can be added.
The script will produce backups dated like this: Reading-2006.05.02.owworkspace
Code:
#!/bin/sh cd ~/Library/Application\ Support/OmniWeb\ 5/Workspaces cp Reading.owworkspace Backups/Reading-`date "+%Y.%m.%d"`.owworkspace
Then make a new launchd entry, and put it in ~/Library/LaunchAgents. (Make the folder if it's not already.) Again, just another text file. Replace "USER" with your username. The backup time here is set to 5:55 am.
In order to make it backup more than once a day, you need to make a new launchd entry; that is, a new file and a new label (instead of USER.OWworkspacebackup, say, USER.OWworkspacebackup.1 and USER.OWworkspacebackup.2). If you do this, you need to change the above script to add the time to the backups' filenames (`date "+%Y.%m.%d.%H.%m"; see man strftime for other date-time options).
(The path to the script here has to be the full path, so no ~/Library/...; note that spaces and other normally escaped characters do not need to be escaped here.)
Code:
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>Debug</key> <false/> <key>GroupName</key> <string>USER</string> <key>Label</key> <string>USER.OWworkspacebackup</string> <key>ProgramArguments</key> <array> <string>/Users/USER/Library/Application Support/OmniWeb 5/Workspaces/Backups/backup.sh</string> </array> <key>StartCalendarInterval</key> <dict> <key>Hour</key> <integer>5</integer> <key>Minute</key> <integer>55</integer> </dict> <key>UserName</key> <string>USER</string> </dict> </plist>
Lastly, to activate it, do launchctl load on the launchd file in the terminal.
I hope somebody finds this useful; if you have any questions, let me know.