Commit ff7ab923 authored by Olivier's avatar Olivier
Browse files

M2-6: add preparation bash scripts

Add “preparation” bash scripts in each folder. These create a
time-stamped backup of the input and ouput, then inport data from
the output of the previous module(s) into the input, then clear
the output.
parent 86f49bc1
#!/bin/bash
# Input parameters
inputfolder='script_input-real'
outputfolder='script_output-real'
timestamp=$(date "+%Y-%m-%d+%H%M%S")
outputbackupname="backup_output_$timestamp.tar"
inputbackupname="backup_input_$timestamp.tar"
# Create archive of output folder
mkdir -vp archives
tar -cvf $outputbackupname --exclude=old $outputfolder
mv -vf $outputbackupname archives/
tar -cvf $inputbackupname --exclude=old $inputfolder
mv -vf $inputbackupname archives/
# Clear output folder
rm -rvf $outputfolder/*
# Import any PNG from input into output
rsync -avh --delete $inputfolder/*.png $outputfolder/
echo "end of script."
......@@ -4,11 +4,6 @@
inputfolder='script_input'
outputfolder='script_output'
# Cleanup output folder
mkdir -v $outputfolder/old
rm -rvf $outputfolder/old/*
mv -vf $outputfolder/* $outputfolder/old/
# Copy every tex file in the input folder into the output folder
cp -vf $inputfolder/*.tex $outputfolder/
cp -vf $inputfolder/*.png $outputfolder/
......
#!/bin/bash
# Input parameters
inputfolder='script_input-real'
outputfolder='script_output-real'
timestamp=$(date "+%Y-%m-%d+%H%M%S")
outputbackupname="backup_output_$timestamp.tar"
inputbackupname="backup_input_$timestamp.tar"
# Create archive of output folder
mkdir -vp archives
tar -cvf $outputbackupname --exclude=old $outputfolder
mv -vf $outputbackupname archives/
tar -cvf $inputbackupname --exclude=old $inputfolder
mv -vf $inputbackupname archives/
# Import output of M2 into input of M3
rsync -avh --delete ../M2_customize_assignments/script_output/ $inputfolder/
# Clear output folder
rm -rvf $outputfolder/*
echo "end of script."
#!/bin/bash
# Input parameters
inputfolder='script_input-real'
outputfolder='script_output-real'
timestamp=$(date "+%Y-%m-%d+%H%M%S")
outputbackupname="backup_output_$timestamp.tar"
inputbackupname="backup_input_$timestamp.tar"
# Create archive of output folder
mkdir -vp archives
tar -cvf $outputbackupname --exclude=old $outputfolder
mv -vf $outputbackupname archives/
tar -cvf $inputbackupname --exclude=old $inputfolder
mv -vf $inputbackupname archives/
# Import output of M3 into input of M4
rsync -avh --delete ../M3_generate_assignments/script_output/ $inputfolder/
rsync -avh ../M2_customize_assignments/script_output/output_assignments.csv $inputfolder/
# Clear output folder
rm -rvf $outputfolder/*
echo "end of script."
#!/bin/bash
# Input parameters
inputfolder='script_input-real'
outputfolder='script_output-real'
timestamp=$(date "+%Y-%m-%d+%H%M%S")
outputbackupname="backup_output_$timestamp.tar"
inputbackupname="backup_input_$timestamp.tar"
# Create archive of output folder
mkdir -vp archives
tar -cvf $outputbackupname --exclude=old $outputfolder
mv -vf $outputbackupname archives/
tar -cvf $inputbackupname --exclude=old $inputfolder
mv -vf $inputbackupname archives/
# Clear output folder
rm -rvf $outputfolder/*
# Import output of M5 into input of M6
rsync -avh --delete ../M5_collect_submissions/renamed\ pdfs/ $inputfolder/pdf/
rsync -avh ../M2_customize_assignments/script_output/output_assignments.csv $inputfolder/
echo "end of script."
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment