Hi @methsploit,
In short to remove all job history you need to mark all jobs in the job history table and choose delete action for them.
To do it, you can can go to the job history page and then left mouse click
the first job row, then go to the last job on the last job history table page and press SHIFT + left mouse click
on the last job row in the table. This way all jobs in the table will be marked (by orange color). Now you can choose in the Actions
field the Delete
action and confirm my OK
. It will delete all selected jobs.
Please note that this way of removing jobs was designed to remove single jobs so it will remove job by job. If you have many jobs (ex. more that 500
) it can take long time and even it can time out if HTTP request timeout will be achieved. You also will see warning in Bacularis that says about it.
But please don't worry. There are easier ways of removing all jobs. You can go to the Console page at:
[Main menu] => Console
Then you can type this bconsole
command:
list jobs
Remember first and last jobids in the output table and then run in the same Console page:
delete jobid=YOUR_FIRST_JOBID-YOUR_LAST_JOBID
For example, if you have first jobid 1
and last jobid 1400
, the command will be:
delete jobid=1-1400
The last third method of resetting job history and the same re-create all the database data structure is removing and creating the SQL tables. Bacula provides scripts for doing it. They are:
For PostgreSQL
delete_postgresql_tables
make_postgresql_tables
For MySQL
delete_mysql_tables
make_mysql_tables
Here you can see example for Ubuntu with PostgreSQL:
# delete all SQL tables
su postgres -c 'db_name=bacula /usr/share/bacula-director/delete_postgresql_tables'
# re-create all SQL tables
su postgres -c 'db_name=bacula /usr/share/bacula-director/make_postgresql_tables
# grant privileges for new tables
su postgres -c 'db_name=bacula db_user=bacula db_password=YOUR_DB_PASSWORD /usr/share/bacula-director/grant_postgresql_privileges'
IMPORTANT: Please note that the last method is the quickest BUT it removes all the Bacula Catalog data including clients, volumes, pools ...etc. so use this method only if you want to reset all the Bacula environment, not only the job history.
Good luck!
Best regards,
Marcin Haba (gani)