Lab manual
Data archiving
How to archive a finished or stale lab project to the lab's Azure storage, and how to get it back. Use it when a project ends (see research) or when someone leaves the lab (see offboarding).
Last update: October 2026. Names, versions and links may have changed since then. If something here does not match what you see, ask the PI or CeMM IT.
Archive details
| Storage account | strendeiroarchive (resource group rg-rendeiro-archive, subscription "Rendeiro Dev") |
| Archive script | scripts/archive_project.sh |
| Staging folder on the cluster | /nobackup/lab_rendeiro/archive_staging/ (tarballs and inventory.csv) |
| Who can give access | PI (André Rendeiro) or CeMM IT |
Before you start (once per person)
Ask for access. Ask the PI or IT for the role Storage Blob Data Contributor on the resource group rg-rendeiro-archive.
Use the right network. Uploads and downloads only work from the CeMM cluster or a CeMM office computer, not from home or VPN.
Get the script. Save it in your home folder and run it from there. It works with absolute paths, so it does not matter where your project is.
cd ~ curl -fsSLO https://raw.githubusercontent.com/rendeirolab/lab-manual/main/scripts/archive_project.sh chmod +x archive_project.sh ./archive_project.sh --helpCheck that the needed programs are installed:
./archive_project.sh --checkInstall anything marked
MISSING. The script prints a hint for each:Program What it's for How to get it az(Azure CLI)login and checking uploads uv tool install azure-cli(if that fails, add--prerelease allow), orpip install --user azure-cliazcopy(v10)uploading and downloading module load azcopyif the cluster has it, otherwise download from https://aka.ms/downloadazcopy-v10-linux and put theazcopyfile in a folder on your PATH (e.g.~/bin)pigzfast compression usually installed; otherwise module load pigz,conda install -c conda-forge pigz, or ask HPC adminstar,sha256sum,openssl,base64packing and checksums standard on Linux If a program is installed but
--checkstill saysMISSING, the shell can't find it because its folder is not on yourPATH. After auvinstall, runuv tool update-shelland open a new terminal.Log in to Azure. Open the link it prints and enter the code:
az login --use-device-code az account set --subscription "Rendeiro Dev" export AZCOPY_AUTO_LOGIN_TYPE=AZCLI # lets azcopy reuse this login; add the line to ~/.bashrc to keep itRun
./archive_project.sh --checkagain; it should now sayAzure login as <you>, subscription 'Rendeiro Dev'.
Archive a project
The script works on projects in /nobackup/lab_rendeiro/projects/ on the cluster. If data is only on the Hilde workstation, copy it into the project folder on the cluster first.
Work on a compute node, not the login node, inside
tmuxorscreenso a dropped connection does not stop the work. Example (partition names may differ):srun -p interactiveq -c 16 --mem 16G -t 12:00:00 --pty bashFor very large projects (several TB), use the
sbatchexample in step 7 instead.Push your code. Commit and push everything to GitHub, then check:
git -C /nobackup/lab_rendeiro/projects/<project> status -sbIt should list no changed files and show no
[ahead N]next to the branch name.Write
ARCHIVE.mdin the project folder using the template at the end of this page.Look at the project:
./archive_project.sh --dry-run <project> <owner-email><project>is the folder name in/nobackup/lab_rendeiro/projects/(no spaces), not a path.<owner-email>is the email of the person responsible for the data.This prints folder sizes and counts the links that point to data outside the project. The links are listed in
/nobackup/lab_rendeiro/archive_staging/<project>/external_symlinks.txt. That data is not archived, so mention it inARCHIVE.md.Decide what to leave out. Always left out:
.venv, caches, SLURM logs,wandb/(local W&B run files),.nextflowand Podman folders (./archive_project.sh --helphas the full list). The.gitfolder is kept. You decide on the rest, for example:- public data you can download again (TCGA, CAMELYON, …)
- other labs' data
- temporary copies that can be regenerated
Write down what you leave out in
ARCHIVE.md. If the project has personal or clinical data, ask the PI before you archive it, and say so inARCHIVE.md.Build the tarballs (nothing is uploaded yet):
./archive_project.sh --package-only [options] <project> <owner-email>Options you may want:
Option When to use it Example --exclude PATTERNLeave out a folder. The pattern starts with the project name and may use *. Repeat for several.--exclude 'myproj/data/tcga'--split DIRBig projects: one tarball per sub-folder of DIR(e.g. per experiment), so you can later restore one part. Files directly inDIRstay in the main tarball. Repeat for several folders.--split results--level 1Faster compression. Works well for image data. --threads NUse more CPUs (default 8). Match what you requested from SLURM. --threads 16You get one tarball for the
/nobackupfolder (<project>.nobackup.tar.gz) and, if/research/lab_rendeiro/projects/<project>is a real folder (not a link), one for it too (<project>.research.tar.gz). They are written to/nobackup/lab_rendeiro/archive_staging/<project>/, which needs about as much free space as the project.If the run stops partway, run the same command again; finished tarballs are reused. This also means that changed options are ignored for finished tarballs: to rebuild with other options, delete that folder first.
Upload. Run the same command with the same options again, but without
--package-onlyand with the storage account:./archive_project.sh --account strendeiroarchive [same options] <project> <owner-email>At the end, each file should show
OK ... tier=Archive. If you seeMD5 mismatch, stop, do not delete anything, and ask for help.An archive is never overwritten, so a project name can be archived only once. To archive the same project again, ask the PI or IT to move or delete the old archive first.
For very large projects (several TB), run steps 6 and 7 as one job. The script packs, then uploads:
sbatch -p <partition> -c 16 --mem 16G -t <time-limit> \ --wrap "$HOME/archive_project.sh --threads 16 --account strendeiroarchive [options] <project> <owner-email>"Record it. Check that the script added your project to the inventory:
grep <project> /nobackup/lab_rendeiro/archive_staging/inventory.csvThen mark the project as archived in the Lab Project Registry (see record keeping) and tell the PI and your Data Management representative that the project is archived. Deleting the project also deletes its
cemm_metadata.jsonfiles.Clean up only after the PI agrees, and at least 7 days after upload. First check the manifest (see Look inside an archive). Then check that these are the right folders and delete them:
ls -d /nobackup/lab_rendeiro/archive_staging/<project> /nobackup/lab_rendeiro/projects/<project> /research/lab_rendeiro/projects/<project> rm -rf /nobackup/lab_rendeiro/archive_staging/<project> rm -rf /nobackup/lab_rendeiro/projects/<project> rm -rf /research/lab_rendeiro/projects/<project> # if it exists
Look inside an archive
This is quick and very cheap. It needs the login and subscription from "Before you start".
azcopy copy "https://strendeiroarchive.blob.core.windows.net/manifests/<project>/*" ./<project>-manifest/ --recursive
Open ARCHIVE.md, the *.filelist.txt files (what is in each tarball) and external_symlinks.txt (data that was not archived). You can also browse the manifests container in the Azure portal from a CeMM office computer.
Get a project back
This needs the login and subscription from "Before you start".
- Find the tarball name you need in the file list (see Look inside an archive). Names look like
<project>.nobackup.tar.gz,<project>.research.tar.gzor, for--split,<project>.nobackup.<DIR>-<subfolder>.tar.gz. By lab convention thedatafolder lives under/researchand is only linked from/nobackup, so you need theresearchtarball to get the data. - Request it. This takes up to 15 hours:
az storage blob copy start --auth-mode login --account-name strendeiroarchive \ --source-container archive --source-blob "<project>/<tarball>" \ --destination-container restore --destination-blob "<project>/<tarball>" \ --tier Hot --rehydrate-priority Standard - Check if it's ready. Repeat every few hours until it says
success:az storage blob show --auth-mode login --account-name strendeiroarchive \ -c restore -n "<project>/<tarball>" --query properties.copy.status -o tsv - Download and unpack in the folder where the project should live (
/nobackup/lab_rendeiro/projects/, or/research/lab_rendeiro/projects/for theresearchtarball). The tarball contains a top-level<project>/folder.
To check the download, copyazcopy copy "https://strendeiroarchive.blob.core.windows.net/restore/<project>/<tarball>" ./ tar -I pigz -xf <tarball>SHA256SUMSfrom the manifest next to the tarball and runsha256sum -c --ignore-missing SHA256SUMS.
The copy in restore deletes itself after 14 days, and the archive itself is never changed.
When someone leaves the lab
See also the checklist for the PI in offboarding.
- Before they leave, they archive their finished or stale projects (see Archive a project).
- Ask IT to remove their Storage Blob Data Contributor role.
- Update the owner in
inventory.csvif needed. - Ask HPC admins to transfer ownership of their cluster folders to the new owner.
Things that happen automatically
- Archives are deleted 10 years after upload.
- Files deleted by mistake can be recovered for 30 days. Ask IT.
Template for the archive description
Save this as ARCHIVE.md in the project folder:
# <project>
- Owner: <name, email>
- Archived by: <name>, <date>
- What it is: <2–3 sentences>
- Papers: <DOI or "none">
- Code: <GitHub link + commit>
- What's included: <folders, sizes>
- What's left out and why: <e.g. data/tcga — public, can be downloaded again>
- Data stored elsewhere (not archived): <paths, who owns it>
- Personal/clinical data?: <yes/no, ethics reference; ask the PI before archiving such data>
- How to rerun: <short instructions>
Edit this page on GitHub