Skip to end of metadata
Go to start of metadata

                            Asset Trustee automated database backup

Summary

The Asset Trustee database contains valuable information, is easy to back up, and takes very little space. In short, there's virtually no reason not to back up your AT database periodically. This article will describe the steps to create an automated Asset Trustee database backup solution.

First, download this Script.

While the script contains most of what is necessary, it needs to be modified to suit your needs. Open it with a UNIX text editor (vi, BBEdit, TextWrangler, etc.).

There are two things you must modify:


  1.  Change the variable (Backup_Path) to the place where you would like your Asset Trustee backups to be stored. The $(date ...) part is there to timestamp the backup.  
    Backup_Path=/Users/stevel/AssetTrusteeBackups/asset_trustee-DB$(date "+%Y.%m.%d-%H.%M.%S")  
    For example, let's change it to:  
    Backup_Path=/Volumes/BackupHD/AssetTrustee/asset_trustee-DB$(date "+%Y.%m.%d-%H.%M.%S")
  2. Input your root MySQL password in the place of 'yourPassword'  
    MySQL_root_pass=Kermit8748  
    The rest of the script needs no modification.


Finally, use the Terminal to change the permissions and move the file to its proper place (It must be on the AT Inventory computer). Here are the two commands. Note that you need to provide the path to the script. 


Code:
%sudo chown root:wheel /pathTo/theScript/777.backupATSQLDB.sh 
Password: [input your admin password] 

%sudo chmod 700 /pathTo/theScript/777.backupATSQLDB.sh 

%sudo mv /pathTo/theScript/777.backupATSQLDB.sh /etc/periodic/weekly/


Well done! Now AT will automatically backup its database every week (if you want to do it every day, or every month, switch /weekly/ with /daily/ or /monthly/). Depending on the size of your AT database, the zipped file will be between 1 and 100MB.