File: mergeall-products/unzipped/android-scripts-and-gui/scripts/mergeall-data-to-plug-report.sh

#!/usr/bin/bash
# File: mergeall-data-to-plug-report.sh
#--------------------------------------------------------
# Run the main Mergeall script on Android to report 
# differences between your $data and $plug content copies.
# This allows you to preview changes before propagating 
# them from $data to $plug with a follow-up update run.
# This uses path variables set in your ~/.bash_profile.
# See _README.html for all general usage instructions.
#--------------------------------------------------------

# Load current path settings
source ~/.bash_profile

# Run in work folder for logs
pushd $work > /dev/null
echo "Starting: $PWD"

# Route logfile output here
logdir=Admin-Mergeall

# Filename passed as arg else generated
if [ $# == 1 ]
then
    logname=$1
else
    logname=mergeall-$(date +%Y%m%d-%H%M%S).txt
fi

# Create logfiles dir if needed
if [ ! -e $logdir ] 
then
    mkdir $logdir
    echo "Created $logdir"
fi

# Run and save log, py's -u may or may not help tails
python -u Mergeall-source/mergeall.py \
    $data \
    $plug \
    -report -skipcruft \
        > $logdir/$logname

# Back to starting dir
popd > /dev/null
echo "Finished: $PWD"



[Home page] Books Code Blog Python Author Train Find ©M.Lutz