# Controlling a backup client

The `bbackupctl` program sends control commands to the `bbackupd` daemon. It must be run as the same user as the daemon, and there is no exception for root.

The command line syntax is

      /usr/local/bin/bbackupctl [-q] [-c config-file] command

The `-q` option reduces the amount of output the program emits, and `-c` allows an alternative configuration file to be specified.

Valid commands are

terminate
  Stop the `bbackupd` daemon now (equivalent to `kill`)
reload
  Reload the configuration file (equivalent to `kill -HUP`)
sync
  Connect to the server and syncronise files now. (See below)

It communicates with the server via a UNIX domain socket, specified in `bbackupd.conf` with the `CommandSocket` directive. This does not need to be specified, and `bbackupd` will run without the command socket, but in this case `bbackupctl` will not be able to communicate with the daemon.

Some platforms cannot check the user id of the connecting process, so this command socket becomes a denial of service security risk. `bbackupd` will warn you when it starts up if this is the case on your platform, and you should consider removing the `CommandSocket` directive on these platforms.

## Using bbackupctl to perform snapshots

`bbackupctl`'s main purpose is to implement snapshot based backups, emulating the behaviour of traditional backup software.

Use `bbackupd-config` to write a configuration file in `snapshot` mode, and then run the following command as a cron job.

      /usr/local/bin/bbackupctl -q sync

This will cause the backup daemon to upload all changed files immediately. `bbackupctl` will exit almost immediately, and will not output anything unless there is an error.

© Ben Summers, 2003, 2004