Jun 04, '03 08:45:00AM • Contributed by: athagon
I've created an Applescript to automate the backing up, and archiving, of Uplink agent files. One will need to create a directory into which the agent file backups will go (mine is ~/Documents/Agent Backups). Here is the script:
set right_now to do shell script "date | awk '{print $1,$2,$3,$6,$4}'"
do shell script ¬
"cd ~/Documents/\"Agent Backups\"/ ; tar cvf \"" & ¬
right_now & ".tar\" *.usr ; gzip \"" & right_now & ".tar\""
-- the next three lines are one long line, but you'll have
-- to manually combine the last two segments, as you can't
-- put an AppleScript line break in a shell command!
do shell script ¬
"cp \"/Applications/Games/Uplink 1.0.0/Users/\"*.usr
~/Documents/\"Agent Backups\"/"
launch application "TextEdit"
The script should be entered into Script Editor as four lines, and saved as an application. One will also probably want to put it into one's dock, so that the agent files can be backed up and archived and Uplink can be launched with only one click. Before using the script, one will want to change the backup paths in the "do shell script" commands to match whatever backup architecture one has created. The script does the following:- Archives any currently un-archived backed up agent (.usr) files into a tarball using the current date and time as the filename (this is handy if one needs to revert to an even older version of an agent file).
- Backs up one's current agent files.
- Starts Uplink.
