aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
-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