diff --git a/fs_filecheck/opt/groomer/config.sh b/fs_filecheck/opt/groomer/config.sh index f4612fc..f749abe 100755 --- a/fs_filecheck/opt/groomer/config.sh +++ b/fs_filecheck/opt/groomer/config.sh @@ -14,7 +14,7 @@ DST_MNT="/media/dst" TEMP="${DST_MNT}/temp" ZIPTEMP="${DST_MNT}/ziptemp" LOGS="${DST_MNT}/logs" -GROOM_LOG="/tmp/groom_log.txt" +DEBUG_LOG="/tmp/groomer_debug_log.txt" MUSIC="/opt/midi/" @@ -24,3 +24,6 @@ TIMIDITY="/usr/bin/timidity" MOUNT="/bin/mount" PMOUNT="/usr/bin/pmount -A -s" PUMOUNT="/usr/bin/pumount" + +# Config flags +DEBUG=true diff --git a/fs_filecheck/opt/groomer/groomer.sh b/fs_filecheck/opt/groomer/groomer.sh index 7a3e989..daeb027 100755 --- a/fs_filecheck/opt/groomer/groomer.sh +++ b/fs_filecheck/opt/groomer/groomer.sh @@ -12,7 +12,11 @@ if ! [ "${ID}" -ge "1000" ]; then exit fi -clean(){ +clean(){ + if [ ${DEBUG} = true ]; then + sleep 20 + fi + # Write anything in memory to disk ${SYNC} @@ -58,7 +62,7 @@ do # Create a directory on ${DST} named PARTION_$PARTCOUNT target_dir="/media/${DST}/FROM_PARTITION_${PARTCOUNT}" mkdir -p "${target_dir}" - LOGFILE="${LOGS}/processing.txt" + LOGFILE="${LOGS}/processing_log.txt" # Run the current partition through filecheck.py echo "==== Starting processing of /media/${SRC} to ${target_dir}. ====" >> ${LOGFILE} diff --git a/fs_filecheck/opt/groomer/init.sh b/fs_filecheck/opt/groomer/init.sh index adc4b6d..e23f744 100755 --- a/fs_filecheck/opt/groomer/init.sh +++ b/fs_filecheck/opt/groomer/init.sh @@ -13,6 +13,9 @@ if [ ${ID} -ne 0 ]; then fi clean(){ + if [ ${DEBUG} = true ]; then + sleep 20 + fi echo "GROOMER: cleaning up after init.sh." ${SYNC} # Stop the music from playing @@ -30,7 +33,8 @@ setterm -powersave off -blank 0 echo $! > /tmp/music.pid # List block storage devices for debugging -# Make sure to set tee in append (-a) mode below if you uncomment -# lsblk |& tee ${GROOM_LOG} +if [ ${DEBUG} = true ]; then + lsblk |& tee -a ${DEBUG_LOG} +fi -su ${USERNAME} -c ./mount_dest.sh |& tee ${GROOM_LOG} +su ${USERNAME} -c ./mount_dest.sh |& tee -a ${DEBUG_LOG} diff --git a/fs_filecheck/opt/groomer/mount_dest.sh b/fs_filecheck/opt/groomer/mount_dest.sh index 720ac47..a32b45d 100755 --- a/fs_filecheck/opt/groomer/mount_dest.sh +++ b/fs_filecheck/opt/groomer/mount_dest.sh @@ -13,10 +13,13 @@ if ! [ "${ID}" -ge "1000" ]; then fi clean(){ - echo "GROOMER: Cleaning up in mount_keys.sh." + if [ ${DEBUG} = true ]; then + sleep 20 + # Copy the temporary logfile to the destination key + cp ${DEBUG_LOG} "${DST_MNT}/groomer_debug_log.txt" + fi - # Copy the temporary logfile to the destination key - cp ${GROOM_LOG} "${DST_MNT}/groomer_log_dst.txt" + echo "GROOMER: Cleaning up in mount_keys.sh." # Write anything in memory to disk ${SYNC} diff --git a/shell_utils/copy_groomer_to_image.sh b/shell_utils/copy_groomer_to_image.sh index fd1a7c1..8529318 100755 --- a/shell_utils/copy_groomer_to_image.sh +++ b/shell_utils/copy_groomer_to_image.sh @@ -2,11 +2,11 @@ set -x -# cp /media/sf_ubuntu-shared/Circlean-Ubuntu/fs_filecheck/opt/groomer/init.sh /mnt/rpi/opt/groomer/init.sh -# cp /media/sf_ubuntu-shared/Circlean-Ubuntu/fs_filecheck/opt/groomer/groomer.sh /mnt/rpi/opt/groomer/groomer.sh -# cp /media/sf_ubuntu-shared/Circlean-Ubuntu/fs_filecheck/opt/groomer/config.sh /mnt/rpi/opt/groomer/config.sh -# cp /media/sf_ubuntu-shared/Circlean-Ubuntu/fs_filecheck/opt/groomer/mount_dest.sh /mnt/rpi/opt/groomer/mount_dest.sh +cp /media/sf_ubuntu-shared/Circlean-Ubuntu/fs_filecheck/opt/groomer/init.sh /mnt/rpi/opt/groomer/init.sh +cp /media/sf_ubuntu-shared/Circlean-Ubuntu/fs_filecheck/opt/groomer/groomer.sh /mnt/rpi/opt/groomer/groomer.sh +cp /media/sf_ubuntu-shared/Circlean-Ubuntu/fs_filecheck/opt/groomer/config.sh /mnt/rpi/opt/groomer/config.sh +cp /media/sf_ubuntu-shared/Circlean-Ubuntu/fs_filecheck/opt/groomer/mount_dest.sh /mnt/rpi/opt/groomer/mount_dest.sh # cp /media/sf_ubuntu-shared/Circlean-Ubuntu/fs_filecheck/opt/groomer/music.sh /mnt/rpi/opt/groomer/music.sh -# cp /media/sf_ubuntu-shared/Circlean-Ubuntu/fs_filecheck/etc/rc.local /mnt/rpi/etc/rc.local +cp /media/sf_ubuntu-shared/Circlean-Ubuntu/fs_filecheck/etc/rc.local /mnt/rpi/etc/rc.local # cp /media/sf_ubuntu-shared/Circlean-Ubuntu/fs_filecheck/etc/pmount.allow /mnt/rpi/etc/pmount.allow # cp /media/sf_ubuntu-shared/Circlean-Ubuntu/fs_filecheck/etc/udev/rules.d/10-usb.rules /mnt/rpi/etc/udev/rules.d/10-usb.rules