System Operation

Housekeeping Tasks

Several day to day housekeeping tasks are performed on the server using either tools implemented by the CatDV Server Control Panel or native operating system commands. To perform these tasks you will need to be logged on to the machine running CatDV Server.

Control Panel Tools

The Tools menu has the following commands:

Perform Housekeeping – once you have been using the system for a while and deleting many individual clips (as opposed to entire catalogs) it is possible that the database may end up containing some dangling unreferenced data. The housekeeping command should be run occasionally to clean up and reduce the size of the database to make it more efficient. You can also configure the server to perform housekeeping automatically when the server starts up. Note that this command can take a long time to complete.

Empty Recycle Bin – normally when clips are deleted they are moved to the recycle in, and are deleted from there automatically after 14 days or when the bin gets too large. You can manually empty it if required using this command.

Copy Archive Status – there is nothing stopping you importing the same media file more than once resulting in multiple independent clips referring to the same asset, so if you are using the CatDV Archiving Option this command will copy the archive status from any clips that have been archived to other clips with the same media path.

Export Database – dump the entire CatDV database to a backup file. This should be done from time to time to supplement your regular backup strategy and also before you update the server or if you need to move the database to another machine.

Import Database – this will import a database dump file created by the Export command and restore the catdv database to that point. Warning: this will replace the entire CatDV database as it currently stands and should only be used to restore the entire database after a crash or when moving the database to another machine.

Starting and stopping the CatDV Server

If configured as described above, under Mac OS X and Windows both MySQL and the CatDV Server should start automatically when the server machine is restarted and stop when the machine shuts down. However, during initial set up, for troubleshooting, and when running under Linux or Unix, you may need to start the server manually, which you can do using the Start and Stop buttons in the relevant section of the Control Panel’s main page.

MySQL Maintenance Tasks

This section describes how to carry out common maintenance tasks with MySQL – the default database server for CatDV Server. If you are using a different database server e.g. Microsoft SQL Server please refer to the relevant documentation as to how to perform equivalent tasks on those systems.


To backup the entire CatDV database to a single flat file shut down the CatDV server and use the commands:

mysqldump -u root -p catdv > backupXXXX.sql

where backupXXXX.sql is a filename you choose (perhaps including today’s date),

The CatDV Control Panel has a convenient command to simplify exporting the CatDV database using the mysqldump program.

IMPORTANT: Because it needs to fit in with your existing backup strategy please note that the CatDV server does not perform any backups automatically by itself. It is your responsibility to ensure that you create regular and adequate backups that meet your requirements. You should also test that your strategy works by performing a restore before you rely on it.

Performing a daily backup using cron (on Mac OS X or Linux)

Using a text editor, create a shell script to do the backup, eg. create a file backup.sh in /usr/local/catdvServer containing:


/usr/local/mysql/bin/mysqldump -u root –proot_password catdv > /XXX/backup-`date +%Y-%m-%d`.sql

Replace XXX with wherever you want the backups to go, for example /Volumes/CATDV/Backups. The file will then be named something like “backup- 2011-07-22.sql”.

You can put the script somewhere else if you prefer, but assuming it’s named as above make it executable by launching a Terminal prompt and typing:

chmod +x /usr/local/catdvServer/backup.sh

Finally, create a cron job by editing your crontab table by typing

crontab -e

in a Terminal window, then adding a line

30 3 * * * /usr/local/catdvServer/backup.sh

The crontab -e command will use your default command line, which may well be vi, in which case beware this is not a normal “just type stuff in” editor!! It has modes and you type single letter commands: type i to enter insert mode, enter the line above, then press Esc to leave insert mode, then ZZ to save and exit. Case is significant!

The first five fields in the crontab line say when you want the command to be performed: minutes (00-59), hours (00-23), day of month (1-31), month (1- 12), day of week (0-6, where 0=Sunday), with a * to mean any value. The line above thus tells it to run the job at 3.30am every day but you could also choose to run the script once per week say.

Restoring database or moving MySQL to another machine

If you need to migrate the CatDV server and database to another machine install MySQL and the CatDV Server on the new machine then shut down MySQL on both machines and backup the MySQL database on the source machine and copy the backup file to the target machine.

On the target machine use the CatDV Server Control panel to create an empty ‘catdv’ database on the target machine and then restore the backup created on the other machine

mysql –u root –p catdv < backupXXX.sql

Where backupXXXX.sql is the name of your backup file. You will be prompted to enter the MySQL root password if any.

Resetting the administrator password

If a normal user forgets his or her password then a CatDV user with systems administrator privileges can reset that user’s password using the user admin page in the CatDV Pro client.

If you forget the system administrator’s password, however, then you need direct access to the database via the command line to reset the password:

mysql –u root –p

You may need to enter the full path to the mysql command, and will need to type in your MySQL root password (not the same as the operating system administrator password) if you have one.

Once you get the mysql> prompt, type the following (including the semicolon):

ALTER USER 'root'@'localhost' IDENTIFIED BY 'New-Password-Here';

This will reset the Administrator account so it has a blank password.

Recovering a ‘crashed’ table

If you power down the server machine without shutting down the CatDV and MySQL server processes first it is possible that the database might be left in an inconsistent state and the CatDV doesn’t start up normally.

If a table is marked as crashed you can usually recover it using the MySQL REPAIR TABLE command as follows.

REPAIR TABLE table_name;