aiidateam / aiida-core

The official repository for the AiiDA code
https://aiida-core.readthedocs.io
Other
435 stars 188 forks source link

Create archive the dst folder check need to happen before the dump and compress start #6167

Closed unkcpz closed 6 months ago

unkcpz commented 1 year ago

When dumping data to the archive with verdi archive create, it takes hours to create the export.zip but the command failed because of the dst folder does not exist. It'll be very helpful if the check can happen before or automatically create a folder with mkdir -p.

prady0t commented 1 year ago

Hey can I work on this?

unkcpz commented 1 year ago

Sure, please go ahead. Pinging me if you need a review or help :)

AryanNanda17 commented 10 months ago
#!/bin/bash

# Get user input for the command, source folder, and destination folder
read -p "Enter the command for dumping/archiving: " custom_command
read -p "Enter the source folder: " source_folder
read -p "Enter the destination folder: " destination_folder

if [ ! -d "$destination_folder" ]; then
    mkdir -p "$destination_folder"
fi

if [ -d "$destination_folder" ]; then
    # Execute the user-provided command with source and destination folders
    eval "$custom_command" "$source_folder" "$destination_folder"
else
    echo "Failed to create destination folder or it does not exist. Exiting..."
    exit 1
fi
AryanNanda17 commented 10 months ago

I think this will resolve the bug. I am not sure

AryanNanda17 commented 10 months ago

@unkcpz Please help me with that.