Generating a session from bash for scripting


I am writing a script to cleanup the old backups in a specific way.

Because when you remove an archiving schedule in the client conf, urbackup won’t unarchive the corresponding backups. (what would be nice would be to give a name to archiving schedules, so we can easily filter remove these)

Anyhow, i got around that by writing a script that does what i want, it works.
I used the python api script and the example as to generate a session and print its number, so that i can use it in my bash script and remove backups.

Would it be possible to generate a valid session in pure bash so that i don’t have to use any dependence?
The python code for that is two hellish long liners of crypto stuff, so i tried to do that myself , then gave up after a few hours and used your python script.

You’ll need to call some external program for the crypto anyway (might work with openssl e.g.) and python is often pre-installed even with minimal installs, so I guess you could to the crypto stuff with python -c in your bash script.