aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorDavid Walter Seikel2012-11-13 18:30:27 +1000
committerDavid Walter Seikel2012-11-13 18:30:27 +1000
commite424e084e77ed393b937f4ec1e726e40a8078da0 (patch)
treea28f84e92b2a7390b950de2cddc84f480d7fc1c5
parentTypo-- (diff)
downloadIGnoble-e424e084e77ed393b937f4ec1e726e40a8078da0.zip
IGnoble-e424e084e77ed393b937f4ec1e726e40a8078da0.tar.gz
IGnoble-e424e084e77ed393b937f4ec1e726e40a8078da0.tar.bz2
IGnoble-e424e084e77ed393b937f4ec1e726e40a8078da0.tar.xz
Delete old backups.
-rwxr-xr-xstart-sim5
1 files changed, 5 insertions, 0 deletions
diff --git a/start-sim b/start-sim
index e2e1faa..b280a1d 100755
--- a/start-sim
+++ b/start-sim
@@ -1,5 +1,8 @@
1#!/bin/bash 1#!/bin/bash
2 2
3# Number of days to keep backup OAR files.
4DAYS="15"
5
3USER=$(whoami) 6USER=$(whoami)
4console_name="OpenSim_console" 7console_name="OpenSim_console"
5screen_command="tmux -S /var/run/opensim/opensim-tmux.socket" 8screen_command="tmux -S /var/run/opensim/opensim-tmux.socket"
@@ -97,6 +100,8 @@ case $(basename $0) in
97 ;; 100 ;;
98 101
99 "backup-sim") 102 "backup-sim")
103 # First delete old backups. Using mtime instead of ctime, so that people can touch files the want to keep, and coz ctime seems to have a bug.
104 find "${inidir}/../../backups/" -name "${title// /_}-*.oar" -mtime +${DAYS} -type f -print0 | xargs -0 /bin/rm -f
100 # Substitute underscores for spaces in the title, then add the full date and time to create the OAR file name. 105 # Substitute underscores for spaces in the title, then add the full date and time to create the OAR file name.
101 cmd="save oar ${inidir}/../../backups/${title// /_}-$(date '+%F_%T').oar" 106 cmd="save oar ${inidir}/../../backups/${title// /_}-$(date '+%F_%T').oar"
102 ${screen_window}:"[${title}]" \; send-keys "${cmd}" Enter 107 ${screen_window}:"[${title}]" \; send-keys "${cmd}" Enter