Given a directory full of Prairie datasets, this script performs the following actions:

  1. Converts each dataset to compressed OME-TIFF. There will be one OME-TIFF file per dataset, rather than the potentially thousands of single-plane TIFF files in a Prairie dataset. It stores these OME-TIFFs in a mirror of the directory structure in a separate base folder.
  2. Archives each entire original Prairie dataset as a ZIP file, again in a mirrored, separate directory structure.
  3. Lastly, if the conversion and archiving both were successful, it deletes the original folder to save space (though if you do not want this, of course it can be disabled in the script).

To save more space, the ZIP files can then be moved to an offsite backup server using a smart syncing tool (e.g., arRsync for OS X works well, though there are many options).

Caveats

  1. The script works only on OS X and Linux, not Windows. (Though it might work with Cygwin; this is untested.)
  2. Do not press Ctrl+C to kill the script during OME-TIFF conversion; it will not terminate properly and may delete original data that was not successfully archived first.
Language
Bash
Installation and Usage

Save the script to a folder of your choice. Then execute it from the command line (e.g., Terminal on OS X):

 

/path/to/prairie-backup.sh MyData MyTIFFs MyZIPs

Where:

  • /path/to is where you saved the script
  • MyData is the base directory containing your Prairie datasets
  • MyTIFFs is the directory structure in which to store the converted OME-TIFFs
  • MyZIPs is the directory structure in which to store the ZIP archives

If MyTIFFs or MyZIPs directories do not exist, they will be automatically created.