-
Notifications
You must be signed in to change notification settings - Fork 12
Scripting with Fusera
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.
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
The other type of "interface" files fusera utilizes are . These files show up when there is an error with an accession and appear under that accession's folder. These errors can relate to only one file under the accession, all the files, or to an issue with the whole accession. A user can manually read these files, but scripts could also be written to recognize these error files in order to skip that accession and could even record the errors in the error files for quite a clean report showing which accessions were not processed and why.