aiida-core
aiida-core copied to clipboard
Create archive the dst folder check need to happen before the dump and compress start
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
.
Hey can I work on this?
Sure, please go ahead. Pinging me if you need a review or help :)
#!/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
I think this will resolve the bug. I am not sure
- where to make the file data_dump_script.sh
- what is the destination path and the source folder.
- what is the custom dump command.
@unkcpz Please help me with that.