Automated Ubuntu
-
I have installed Mango Automation a few days ago and I am really impressed. Now that we are in the middle of a very busy project, I don't really have the time to look at all the details or even read the user guide (if one actually exists, lol). I keep adding more and more datapoints every day.
Does anybody know a simple way to get a cron job running with some simple backup?
So that I don't have to worry about having to do it all over again if in worst case the server has some problems?Could I just backup/tar the mango directory while mango is running once a day and transfer it to a backup server? I have all the things in place to do backup and file transfers, I am just not sure what I have to include and if it would actually be safe to do so.
Alex
-
This is where the mango import/export feature really shines (well, this and mass point creation). Taking the time to create backups by exporting all your configuration (data sources, points, point hierarchies, users, etc, etc) by exporting all and saving the JSON would save you heaps of space. Maybe set a cron job asking a user to save the full export? This will exist as a feature of our next release, automatically saving the export to a text file.
More to your question, if you're operating Mango on a derby database (the default is an embedded derby database), you might be able to backup your mango as you described, but I don't know if it's a good idea. I would think backing up the folder while mango runs would eventually degrade your database if you find yourself doing restores regularly or you have a particularly active database, but that's somewhat speculation. Really, you should just stop the database connections (or Mango entirely) to perform a backup of the folder.
Backing up the folder has the benefits of 1) backing up any DGLux dashboards you create, 2. backing up your personal file additions to graphic views, 3. backing up scripts (these are also backed up in the export, though). If you don't need to back up the first two (and you're using derby), you should be fine to stop your database connections and back up only the /mango directory/madb folder.
If you're running on an SQL database that isn't on the Mango computer, your configuration of datasources, datapoints, etc. is in that database, not the Mango folder.
As far as writing it into a system script, if you've configured Mango as a service you should be able to write "service mango start" and "service mango stop" in your bash.
-
Thanks Phil, very helpful info.
So far Mango is still running with the derby database and I have manually started it. As mentioned, we are very pressed for time and I was impressed that it worked like this out of the box.
Do you by chance have a link to official info to start it as a service? I can then put some clean bash script together for stopping, backup up, and restarting Mango (and maybe transferring it to an offsite location). And I can share it right here.
Alex
PS: Once the project is complete, I'll have the time to set this all up properly with external database etc.
-
Joel posted a .conf file that adds that functionality some months ago: http://forum.infiniteautomation.com/forum/posts/list/1408.page
We definitely would appreciate seeing whatever you put together!