Hi,

I'm not an expert but i use this bash script to remove all old jobs in my 
debian Bareos server catalog (work with Mysql only)
You can use Adminer.php or phpmyadmin for manual deleting


This script will remove all you're old jobs => older than 1 hour :)


The script :
____________________________________________________________________________________________
#!/bin/bash

# Change this values to your bareosdatabase's login
userdb='bareos'
passdb='xxxxxxxxxxxxx'



catalogFile=`find /etc/bareos/bareos-dir.d/catalog/ -type f`
dbUser=`grep dbuser $catalogFile | grep -o '".*"' | sed 's/"//g'`
dbPwd=`grep dbpassword $catalogFile | grep -o '".*"' | sed 's/"//g'`

OldVols=$(mysql bareos -u$userdb -p$passdb -se "SELECT VolumeName FROM 
Media WHERE LastWritten < (NOW() - INTERVAL 1 HOUR);")


for volName in $OldVols
do
/bin/bconsole << EOD
delete volume=$volName yes
quit
EOD
done
_________________________________________________________________________________

Like I said, I am far from an expert. *So wait to see other answers to 
confirm this.*

Good luck.

Le lundi 21 juin 2021 à 12:52:48 UTC+2, [email protected] a écrit :

> Hi,
>
> what would be the correct way to remove all previously run backupjobs from 
> bareos? I'm changing my backup schedule and want to start 'fresh'. This is 
> for all configured servers, jobs, etc....  I want to keep the job 
> definitions of course, but the database should be cleared.
>
> Is there a command to purge all knowledge about previous runs from bareos?
> Deleting the data is easy, that's just rm on a couple of folders on my 
> backup server, but the rest I don't know what the best way is to do that.
>
> best regards,
> Andy
>

-- 
You received this message because you are subscribed to the Google Groups 
"bareos-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/bareos-users/d5948b21-1833-4fa7-b8cf-1a844e93a3d1n%40googlegroups.com.

Reply via email to