Remove_unknown, repair_database, defrag_database and other scripts

I searched for, but cant find anything.

Could anyone explain me two things about each script in urbackup installation dir:

  1. what does script do?
  2. in which situation it should be used?

Very appriciate any explanations.

assemble_disk_image.bat - what for?
cleanup.bat - this one i know starts cleanup procedure, ok.
cleanup_database.bat
defrag_database.bat - ???
remove_unknown.bat - ok, this is the only one explained in docs
repair_database - in which situations should be used?
etc.

Is there any scripts that can help me emprove backup speed of URBackup installed in Windows?

Thank you in advance.

Funny_bunny wrote,
Is there any scripts that can help me improve backup speed of URBackup installed in Windows?
The general answer is, no.
The greatest impediment to fast backup is the drive(s) used to hold the the backup.
On a 1Gbps network, with urbackup server running on a truenas box with a 12 drive array, backups proceed at 500Mbps and complete a backup of several million files in less than hour.
On a 7200 RPM SATA drive, the same backup takes less than 2 hours and pushes the “Files in Queue” number into the hundreds or thousands.
On a 5400 RPM USB 3.0 Connected drive, the backup takes around 8 hours and pushes the “Files in Queue” number over one million.

All for now

1 Like

Thank you for your answer.
But what about the scripts? What exactly does they do each one?

Nobody? Nothing?

The scripts are for database managment and never need to be run unless you have some issue with the data store having an issue and loosing data, the scripts will check that data to the database and correct (generally delete anything that its not sure about).

The speed as mentioned will be the drive issue, we tried to run this on windows and it didnt work well, we run it directly on a QNAP NAS now, even with spinning drives we dont see a huge issue, backups can take a while (we have machines over 2Tb) but they are always done with in a day, incrementals are 10-15 mins max.

Hi funny_bunny

assemble_disk_image.bat is used to assemble a disk image into a useable, mountable volume. If you give it a incremental backup it will assemble any needed incremental and full backups to make a full VHD file that you can mount in Windows. It will even decompress vhdz files into the VHD.

cleanup.bat is exactly what it says on the tin. It does a cleanup of tasks in the database. Deleting older files to make space according to your settings on backup retention. delete old clients, delete backups marked for deletion, and a few more things.

cleanup_database; i’m not sure about this one. But it should cleanup, well, the database… probably checks the database against what’s on the storage, if it’s not on the storage, delete from the database so both the storage and database are in sync and contain the same, valid data.

remove_unknown.bat is a very dangerous script. It will check both the database and the disk for what’s there, muc like a cleanup, but much more strict and destructive. If there’s a backup on the storage that isn’t present in the database, then it will delete the backup from disk. If there’s a backup on the database, but it isn’t there on the storage, it will delete it from the database.The main problem is, if you have your backup storage disconnected at the moment you run this script, it will basically delete all backup entries in your database as all the files are not there… forcing you to restore the database from backup when the storage is available again (or start from scratch making databases).

defrag_database, defrags the database, what more is there to say…

repair_database does a check and repair if neede on the SQL database used by Urbackup, using build in SQlite commands. You can use this to (hopefully) fix database corruptions.

Very handy for if (when?) the virtual machine plug in appears…

Or you can mount it yourself. assuming you use Windows for Urbackup server, you can just run the batch file with the right arguments yourself.

While convenient, it’s not like you have to use the Urbackup webservice to mount a backup.