Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FEAT] Added sftp sync staging #125

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions utils/sort_samples_dumb
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ done
: "${batch_name:?missing mandatory batch name, use option -b}"
: "${out_dir:?missing mandatory output dir use option -o}"

: "${tsv:=${out_dir}/samples.${batch_name}.tsv}"
: "${tsv:=${out_dir}/samples.${batch_name}.tsv.staging}"


# RegEx
Expand Down Expand Up @@ -225,9 +225,11 @@ if (( numdup )); then
fi
fi
if (( ALLOK )); then
info All Ok
exit 0
mv -v ${tsv} ${tsv//\.staging/}
info All Ok
exit 0
else
warn Some errors
exit 1
warn Some errors
exit 1
fi

20 changes: 12 additions & 8 deletions utils/sort_samples_jobinfo
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ if not os.path.isdir(sampleset):

# output files
batch=f"{date}_{flowcell}"
tsv=open(os.path.join(sampleset,f'samples.{batch}.tsv'), 'wt')
tsv=open(os.path.join(sampleset,f'samples.{batch}.tsv.staging'), 'wt')
# shell script file with all moving instructions inside
sh=open(os.path.join(sampleset,'movedatafiles.sh'), 'at' if append else 'wt')

Expand Down Expand Up @@ -232,13 +232,17 @@ if args.batch:

# coda: return status
if not append: print(f"""
if (( ALLOK )); then
echo All Ok
exit 0
else
echo Some errors
exit 1
if (( !ALLOK )); then
echo Some errors
exit 1
fi;

""", file=sh)

print(f"mv -v {sampleset}/sample.{batch}.tsv.staging samples {sampleset}/sample.{batch}.tsv", file=sh)

print("""
echo All Ok
exit 0
""", file=sh)

sys.exit(0)