Backup script for the Mac

by GRAPHISOFT and Ed Brown · updated: 11.09.2010

/!\ Some programming experience required!


Outline of backup

  1. Test that directories are correctly specified.
  2. Prepare an area on the local disk for the backup
  3. Make the master module backup
  4. Backup non-master module project data into a folder numbered for the version
  5. Copy the backup to another computer which will create the backup media
    • {i} and, Log progress.

How to implement the backup script in your environment

  1. Adjust in the script:
    1. Change the variables:
      1. installDir <== folder of installed modules

      2. localBkUp <== temporary holding place on BIM Server for dumped files

      3. remoteBkUp <== folder where dumped files can be safely stored or backed up from.

  2. If you do not have a module installed you should comment out lines that pertain to that module.
  3. Once you have created a file (named AC16_bkup.bash) make sure in a terminal window to:
    1. Run “chmod +x AC16_bkup.bash”
    2. Tests run the script wth the command “sudo ./AC16_bkup.bash”
  4. Schedule the script to run unattended

The backup script AC16_bkup.bash

Note: Copy/paste to a text file may include carriage returns that prevent the script from correctly running on a mac. The line starting with “#!/bin/bash” should not be indented.

  #!/bin/bash 

installDir="/Applications/Graphisoft/BIM Server/Server Modules/"
localBkUp="/BIMServer_bkup/"
remoteBkUp="/Volumes/public/BkUpTest/"


# test if directories exist and writable, if not exit script and notify
shouldQuit=0
if [[ ! -d "$installDir" ]] ; then
  echo installDir: $installDir does not exist
  exit 1
fi

if [[ ! -d "$installDir/1400" ]] ; then
  echo Version 14 is not installed. Has backup script been correctly modified to handle this?
  shouldQuit=1
fi

if [[ ! -d "$installDir/1500" ]] ; then
  echo Version 15 is not installed. Has backup script been correctly modified to handle this?
  shouldQuit=1
fi

if [[ ! -d "$installDir/1600" ]] ; then
  echo Version 16 is not installed. Has backup script been correctly modified to handle this?
  shouldQuit=1
fi

if [[ ! -d "$localBkUp" ]] ; then
  echo localBkUp: $localBkUp does not exist
  shouldQuit=1
elif [[ ! -w "$localBkUp" ]] ; then
  echo $localBkUp is not writable
  shouldQuit=1
fi

if [[ ! -d "$remoteBkUp" ]] ; then
  echo remoteBkUp: $remoteBkUp does not exist
  shouldQuit=1
elif [[ ! -w "$remoteBkUp" ]] ; then
  echo $remoteBkUp is not writable
  shouldQuit=1
fi

if [[ ! -d "$localBkUp"AC14Project ]]; then
  echo "$localBkUp"AC14Project does not exist
  shouldQuit=1
fi

if [[ ! -d "$localBkUp"AC15Project ]]; then
  echo "$localBkUp"AC15Project does not exist
  shouldQuit=1
fi

if [[ ! -d "$localBkUp"AC16Master ]]; then
  echo "$localBkUp"AC16Master does not exist
  shouldQuit=1
fi

if [[ ! -d "$localBkUp"log ]]; then
  echo "$localBkUp"log does not exist
  shouldQuit=1
fi

if [[ $shouldQuit -eq 1 ]]; then
 exit 1
fi


#clean local temp folder and remove log created by backup tool
rm -rf "$localBkUp"AC14Project/*
rm -rf "$localBkUp"AC15Project/*
rm -rf "$localBkUp"AC16Master/*
rm -rf "$localBkUp"log/*

rm -f "$installDir"1400/TeamworkServer/Logs/ProjectStoreBackupTool.log
rm -f "$installDir"1500/TeamworkServer/Logs/ProjectStoreBackupTool.log
rm -f "$installDir"1600/TeamworkServer/Logs/ServerBackupTool.log


#backup master module files to clean local temp
echo `date` Begin master version 16 backup > "$localBkUp"log/BkUp.log
"$installDir"1600/TeamworkServer/TeamworkServerBackupTool "$localBkUp"/AC16Master  >>"$localBkUp"log/BkUp.log 2>&1
echo `date` End master version 16 backup >> "$localBkUp"log/BkUp.log


#backup projects that are of a lower version than the master module
echo `date` Begin project version 15 backup >> "$localBkUp"log/BkUp.log
"$installDir"1500/TeamworkServer/TeamworkServerProjectStoreBackupTool "$localBkUp"AC15Project  >>"$localBkUp"log/BkUp.log 2>&1
echo `date` End project version 15 backup >> "$localBkUp"log/BkUp.log

echo `date` Begin project version 14 backup >> "$localBkUp"log/BkUp.log
"$installDir"1400/TeamworkServer/TeamworkServerProjectStoreBackupTool "$localBkUp"AC14Project  >>"$localBkUp"log/BkUp.log 2>&1
echo `date` End project version 14 backup >> "$localBkUp"log/BkUp.log


#transfer files to backup medium or server
echo `date` Begin transfer from locally dumped data to backup server >>"$localBkUp"log/BkUp.log
cp -R "$localBkUp" "$remoteBkUp"
echo `date` End transfer from locally dumped data to backup server  >>"$localBkUp"log/BkUp.log


# Add logs to backup files
if [[ ! -d "$remoteBkUp"log ]]; then
  mkdir "$remoteBkUp"log 
fi
cp -f "$localBkUp"log/BkUp.log "$remoteBkUp"log
cp "$installDir"1400/TeamworkServer/Logs/ProjectStoreBackupTool.log "$remoteBkUp"log/ProjectStoreBackupTool_AC14.log
cp "$installDir"1500/TeamworkServer/Logs/ProjectStoreBackupTool.log "$remoteBkUp"log/ProjectStoreBackupTool_AC15.log
cp "$installDir"1600/TeamworkServer/Logs/ServerBackupTool.log "$remoteBkUp"log

Related content

MakeBackup

Backup Files

Opening a Backup Project file (.bpn) allows you to recover the latest backup copy of a damaged project file, provided that the Make Backup Copy checkbox is active in Options > Work Environment > Data Safety & Integrity . Data Safety &…
transferprojects--transfera-b

How to Transfer Projects to Another Computer

ForWikiEditors : ToDo/ - draft This article discusses the process of transferring the ArchiCAD Projects, Libraries, Images, Linked Files from one computer to another. See also: Migration in ArchiCAD Step 1: Export Projects, Library Items and Drawing…
teamwork-transferbimserver--transfer-bim-server-files-method-1

Transfer BIM Server to Another Computer

This article discusses the process of transferring the BIM Server software, Project data, User data, Roles data and Libraries from one computer to another. Please note that there are special considerations for this process. Download article in…
RollbackList

Restoring Project Data Using Backups

Where are the Backup Files Located? Backup files of both kinds (BIM Project backups and PLN backups) are saved to the BIM Server > Projects > Backups folder, at the location where you installed the BIM Server. As long as the BIM Server is running…
BackupsPanel

Backup Teamwork Project

You should create backups of your Teamwork projects to ensure that you can keep working in case of emergency, even if your BIM Server malfunctions. Use the Backups panel of Teamwork Project Settings to create and manage project backups of two kinds: BIM…
BackupFolder

Complete BIM Server Backup

Note: This description is intended for Server Administrators. The command line tools for backing up data from the BIM Server were introduced in ArchiCAD 14. They can be found in the following directories: On MacOS: /Applications/GRAPHISOFT/BIM…
teamwork-bimserverbackupscripts--backupfolder

BIM Server Backup Scripting Tools

Some programming experience required! Preliminaries (the fine print you should read) An effective data safety strategy recognizes that Teamwork data is both distributed and central. This article addresses the central BIM Server database backup, but this…
teamwork-bimserverbackupselectiverestore--backupdirectory

Selective Restore From Backup

The backup data Suppose we have some data we would like to restore from a backup. Here is what the backup folder looks like: Selectively restore a project From the BIM Server Manager choose Create then “Import from file…” Navigate to your backup…