Will post-script run no matter what?

I suppose the post- script will run no matter what?

If so, I think it would be very useful if you could have different scripts for different exit codes. Let’s say post-prune is the catch all script, 0post-prune would be for exit code 0, 1post-prune would be for exit code 1 etc.

Wouldn’t it be easier to pass the exit code to the script and then the script could do different stuff depending on the code?

2 Likes

“Easier” is relative to the person performing the task. :slight_smile: I have never worked with exit codes and wouldn’t even know how to “catch” them in my script… I’d assume I’m not the only one.

(nevermind the other stuff I wrote here a minute ago. I misread your post as a reply to another topic)

I guess @Droolio had in mind that the exit code could be passed to the script as a command-line argument. That sounds more economical than having multiple scripts to cater for each possible exit code.

1 Like

Economical maybe, but not user-friendly. It’s easy to create one or more file names according to a simple pattern and paste a command or two into it. But it immediately becomes a minor programming task to catch the command line argument and handle it appropriately in the script.

If duplicacy would come with a default script template where you just uncomment some stuff, that might be a solution, though.

Is there a “solution” for this? I have used relica backup before. Their approach is to write the status into an Environmentvariable which can than be used in the script. Either way would be fine for me :wink:, but I it would be great to have a way to post to different urls, depending on the exit status of the backup…