#!/bin/bash ############################################################################### # # You must include the following at the top of you script for the script # upload command # ############################################################################### SCRIPTPATH="$( cd "$(dirname "$0")" pwd -P )" SCRIPTNAME="$(echo $0 | awk -F './' '{print $2}')" script="$SCRIPTPATH/$SCRIPTNAME" ############################################################################### # # The following are optional variables and are used here to demonstrate # simplifying multiple notebook entries. # ############################################################################### notebook="Trent's second notebook" folder="My tests" page="Uploaded files" homedir=$HOME ############################################################################### # # Some examples for adding data to LabArchives # # Where the variables $page and $folder are used there must already exist # a corresponding page or folder in your LabArchives notebook # ############################################################################### # Add heading eval $(echo la_page_entry.sh -n \"$notebook\" -f \"$folder\" -p \"$page\" -t \"heading\" -e \"Run 1\") # Add entry text eval $(echo la_page_entry.sh -n \"$notebook\" -f \"$folder\" -p \"$page\" -t \"plain text entry\" -e \"We used the white mice for this experiment.\") # Upload script and environment info eval $(echo laout.sh -n \"$notebook\" -f \"$folder\" -p \"$page\" -s \"$script\") # File uploads will upload duplicate files # Upload a file to top level eval $(echo la_upload.sh -n \"$notebook\" -p \"$page\" -a \"$homedir/Desktop/Test top/test1.txt\" file) # Upload a file to a specific LA folder eval $(echo la_upload.sh -n \"$notebook\" -f \"$folder\" -p \"$page\" -a \"$homedir/Desktop/Test top/test1.txt\" file) # Directory uploads will only upload files once. If run again will upload new files only. It won't delete files. # Upload a directory to top level eval $(echo la_upload.sh -n \"$notebook\" -d \"$homedir/Desktop/Test top\" directory) # Upload a directory to specific LA folder eval $(echo la_upload.sh -n \"$notebook\" -f \"$folder\" -d \"$homedir/Desktop/Test top\" directory) # Add file name with shasum to page eval $(echo la_upload.sh -n \"$notebook\" -p \"$page\" -a \"$homedir/Desktop/Test top/test1.txt\" lasum_file) # Add file name with shasum to page in a specific LA folder eval $(echo la_upload.sh -n \"$notebook\" -f \"$folder\" -p \"$page\" -a \"$homedir/Desktop/Test top/test1.txt\" lasum_file) # Add all file names in a directory in an attachment to a page in a specific folder eval $(echo la_upload.sh -n \"$notebook\" -f \"$folder\" -p \"$page\" -d \"$homedir/Desktop/Test top\" lasum_directory) # Add all file names in a directory in an attachment to a page at the top level in the notebook eval $(echo la_upload.sh -n \"$notebook\" -p \"$page\" -d \"$homedir/Desktop/Test top\" lasum_directory) |