Ok, so I found a bug while making those tests. Everything is fixed now, and here are the explanations:
To sumurize the algorithm:- The workflow requires a project id and the new space_id- We check if the given space_id exists in application.properties, and if the project doesn't already belong to the space_id- From thoses informations, we can compute the path to the new directories- Then, a very similar process will be applied to the project's analyzes, runs, and run's analyzes: Compute old and new directory Update directory in DB Move files Delete the old empty directory Compute the new retention if the given retention is a date : simple, just set a date if given retention is a duration : analysis or run's crdate + retention duration Save the new retention in DB-----------------------------------------------------------------------------------------------------------------------application.properties :[space_default]dir_name=dataretention_period=3[space_seqoccin]dir_name=data_seqoccinretention_date=12/03/2021-----------------------------------------------------------------------------------------------------------------------Project 'purge_mail_test' (id 1292) space_id = 'seqoccin'------------------------------------------------------------------------------------------------------------------------> Analysis 57766directory = /data_seqoccin/analyze/70205e13fcrdate = 1571044081 (Monday 14 October 2019 09:08:01)retention_date = 1615503600 (Thursday 11 March 2021 23:00:00)ls /work/ng6-test/jflow_rtherville/data_seqoccin/analyze/70205e13ftest.txt-> Run 15059directory = /data_seqoccin/run/fbc386b05crdate = 1571044117 (Monday 14 October 2019 09:08:37)retention_date = 1615503600 (Thursday 11 March 2021 23:00:00)ls /work/ng6-test/jflow_rtherville/data_seqoccin/run/fbc386b05md5sum.txt MT_rep1_1_Ch6.fastq.gz MT_rep1_2_Ch6.fastq.gz -> Analysis 57767 directory = /data_seqoccin/analyze/b8abf8aa0 crdate = 1571044237 (Monday 14 October 2019 09:10:37) retention_date = 1615503600 (Thursday 11 March 2021 23:00:00) ls /work/ng6-test/jflow_rtherville/data_seqoccin/analyze/b8abf8aa0 test.txt-----------------------------------------------------------------------------------------------------------------------python3.4 /save/ng6-test/src/ng6-git-rtherville/bin/ng6_cli.py switchprojectspaceid --project-id 1292 --space-id default --admin-login CTDProject 'purge_mail_test' (id 1292) new space_id = 'default'------------------------------------------------------------------------------------------------------------------------> Analysis 57766directory = /data/analyze/70205e13fcrdate = 1571044081 (Monday 14 October 2019 09:08:01)retention_date = 1578996481 (Tuesday 14 January 2020 10:08:01)ls /work/ng6-test/jflow_rtherville/data/analyze/70205e13ftest.txt-> Run 15059directory = /data/run/fbc386b05crdate = 1571044117 (Monday 14 October 2019 09:08:37)retention_date = 1578996517 (Tuesday 14 January 2020 10:08:37)ls /work/ng6-test/jflow_rtherville/data/run/fbc386b05md5sum.txt MT_rep1_1_Ch6.fastq.gz MT_rep1_2_Ch6.fastq.gz -> Analysis 57767 directory = /data/analyze/b8abf8aa0 crdate = 1571044237 (Monday 14 October 2019 09:10:37) retention_date = 1578996637 (Tuesday 14 January 2020 10:10:37) ls /work/ng6-test/jflow_rtherville/data/analyze/b8abf8aa0 test.txt-----------------------------------------------------------------------------------------------------------------------python3.4 /save/ng6-test/src/ng6-git-rtherville/bin/ng6_cli.py switchprojectspaceid --project-id 1292 --space-id seqoccin --admin-login CTDProject 'purge_mail_test' (id 1292) new space_id = 'seqoccin'------------------------------------------------------------------------------------------------------------------------> Analysis 57766directory = /data_seqoccin/analyze/70205e13fcrdate = 1571044081 (Monday 14 October 2019 09:08:01)retention_date = 1615503600 (Thursday 11 March 2021 23:00:00)ls /work/ng6-test/jflow_rtherville/data_seqoccin/analyze/70205e13ftest.txt-> Run 15059directory = /data_seqoccin/run/fbc386b05crdate = 1571044117 (Monday 14 October 2019 09:08:37)retention_date = 1615503600 (Tuesday 14 January 2020 10:08:37)ls /work/ng6-test/jflow_rtherville/data/run/fbc386b05md5sum.txt MT_rep1_1_Ch6.fastq.gz MT_rep1_2_Ch6.fastq.gz -> Analysis 57767 directory = /data_seqoccin/analyze/b8abf8aa0 crdate = 1571044237 (Monday 14 October 2019 09:10:37) retention_date = 1615503600 (Thursday 11 March 2021 23:00:00) ls /work/ng6-test/jflow_rtherville/data_seqoccin/analyze/b8abf8aa0 test.txt
There is a 1 hour shift to the new retentions, but it's normal, they are converted in GMT for this example.
The values are perfect when converted to GMT+1.