Automated oar linux

From Osgrid Wiki
Jump to: navigation, search

This page is dedicated to explaining how to automate oar backup via cron task in linux

First thing you will need to do is add the following line to your OpenSim.ini in the [Startup] section


       timer_Script = "backup.txt"



for this example we will put these scripts in the following location:

/home/user/bin

and backups will go into:

/home/user/backups

and opensim will reside in:

/home/user/opensim/bin


next you will need to create the scripts that cron task will run and the files that these scripts will copy over


the following files go in /home/user/bin

oarbackup_on.sh

oarbackup_off.sh

backup_on.txt

backup_off.txt



backup_on.txt should have the following on line 1:


save oar /home/user/backups/opensim.oar



backup_off.txt should remain blank with nothing inside


oarbackup_on.sh should have the following on line 1:


cp backup_on.txt /home/user/opensim/bin/backup.txt



oarbackup_off.sh should have the following on line 1:


cp backup_off.txt /home/user/opensim/bin/backup.txt



now to setup your cron task run "crontab -e" and add the following 2 lines:


0 0 * * * sh /home/user/bin/oarbackup_on.sh

5 0 * * * sh /home/user/bin/oarbackup_off.sh


this will run your oar backup at 12:00am every day