I have a backup script that simply runs every day and backs up files to a directory if they exist in source dir but not in destination dir.
Sometimes (rarely) the script will fall over if a file isn't permissioned properly.
I've got around this using a try/except
block.
However what I want to do now is to display the error message from the except
block and then to say
>>> Press Enter to re-run backup
and then for the script to re-run the copying process which is a defined function.
So to summarise:
- Script runs
- Script throws error
- User follows instructions from error message
- User presses "Enter" key to re-run the copying function
I am running windows if that makes a difference (when I was googling this problem a lot of the results were to do with python on windows)