Skip to content

Scripting with Fusera

Saul A Kravitz edited this page Jun 20, 2018 · 3 revisions

fusera is designed to be incorporated in scripts, particularly at the startup of virtual machines. The two fusera features intended to support scripting are the .initialized file, and error.log files.

.initialized file

When fusera is launched, the .initialized file is created in the root folder of the fusera file system to indicate that all the files fusera could access have been created in the system and are accessible. Below is an example bash script that starts fusera in the background, then waits for the .initialized file to exist before proceeding. The .initialized file can also be used to detect a valid fusera-mounted file system.

#!/bin/bash

# Wrapper Script for Fusera
# Invokes Fusera in background
# Waits for .initialized file to be created
# Passes through all arguments

_mntpnt=${*:-1}
_flag=$_mntpnt"/.initialized"
fusera "$@" &
echo "waiting for "$_flag
while [ ! -f $_flag ]; do sleep 1; done
echo $_mntpnt" initialized!"
exit

error.log files

fusera creates error.log files within the folder corresponding to an accession when an error occurs. These files can relate to one or more of the files associated with the accession, or relate to an issue associated with the accession itself. These files can be read by a user to figure out what has gone wrong, but can also be read by scripts in order to skip or report on problematic accessions and files.

Clone this wiki locally