The following tools and commands are provided with CloneSys. They are all based on the bash shell.
clone <device> <image_name> <user>
clone clones an image given by its image_name to the mentioned device on the local machine. image_name can be set to default to restore the last installed image.
rclone <device> <image_name> <user> [<host_ids>]
rclone is used similar to clone but it allowes to clone multiple machines at once. The image image_name is installed to device on all the machines given by the host_ids. Use clustermap to show the cluster map with the ids or use the real hostnames instead." With image_name set to default the last installed image will be restored."
The script also mounts the image directory and finally tests whether the clone script could have been started on all the machines. If an error occured on one of the machines, it is displayed and the job is not started on that machine.
backup <device> <image_name> <user> <"comment">
backup generates a backup image of the specified device on the image server under the given image_name. user specifies the user that initiated the backup. The user name will be copied together with the command to an image description file which can be showed with imagedesc. Please make sure to deliver a comment including release number of the system and changes (i.e. new installed software, patches). The comments have to be set in quotes.
A user must be specified because we usually do all the clonings with a special username and it would be impossible to find out who was responsible for a certain backup.
rbackup <device> <image_name> <host_id> <user> <"comment">
rbackup starts the backup script on the machine with the given hostname or host_id which generates a backup image of the specified device to the image server under the provided image_name. user specifies the user that initiated the backup. The user name will be copied together with the comment to an image description file which can be showed with imagedesc. Please make sure to deliver a comment including release number of the system and changes (i.e. new installed software, patches). The comments have to be set in quotes.
The script also mounts the image directory and tests whether the backup script could be started on the remote machine. If an error occured it is displayed and the job is not started.
initinstall <hostname> <user>
initinstall initializes the local machine named hostname with the actual partitioning given in a special image which contains the whole disk. It wipes the whole disk, writes the partitioning information and the MBR and installes the boot loader as well as a small Cloning-System (Linux) which can be used to install further images. user is the user who initialized the disk.
In addition to the initinstall the script initializes the configuration file for the given hostname by copying the corresponding
Caution! This will delete the whole disk!
restore <user> -d [<devices>] -h [<host_ids>]
restore restores the specified devices for all the machines given by their host_ids or name by calling rclone with the default image. This allows to clone more than one device with one command. The synchronization before a second cloning process is startet is handled through the waitfinished command. So be sure that there are no lastlogs with the _running suffix. Use the lastlogs command to delete them if there are.
Caution! This will restore all the partitions on all the machines!
lockimage <device> <hostname> <user> <reason>
lockimage locks the given device for a specified host. user and reason are copied to the cluster configuration files, indicating who locked a device and why. Make sure that reason is only one word.
This locking scheme is a weak one and is only used to prevent administrators to overwrite each others partitions with special setups.
To unlock use unlockimage.
lockimage <device> <hostname> <lockuser> <user>
lockimage unlocks the given device locked by lockuser for the specified host by cleaning the lock in the configuration file. Make sure to have asked lockuser to cancel his lock!
To lock again use lockimage.
state shows all running clone or backup processes as well as a list of the last processes which have finished. It can be used to check whether a cloning process initiated by rclone has terminated.
This simply scans the lastlogs directory for occurences of running or finished processes.
lastlogs [<host_id>] lastlogs -c <logfile> [<host_id>]
lastlogs shows the last log files for the hosts given by
their host_ids or hostnames.
The options are:
||Deletes the specified logfiles containing the following suffixes: clone, backup, lock or error. This can be used to delete last log entries of crashed clone or backup processes which did not change their logfiles anymore.|
waitfinished waits until all clone or backup processes have finished. Optionally writes an email to mailaddress to confirm that the cloning has finished.
Like the state command this tests the lastlogs directory for occurences of running processes.
clonesyslog shows the CloneSys log that contains all logged clone, backup, locking or unlocking operations.
mapname remaps alias names to real hostnames. Allowed aliases are in our case rifpcID (specified in .cloneconfig) or just the hosts ID.
clustermap shows a map of the while cluster. This is just a textfile that has to be changed by hand.
config shows the configuration file of the host given by its id or hostname. In addition it lists all the locked partitions.
rex stands for remote execution and is a script that is used for remote invocation of clone and backup processes. It just executes the command with its arguments which were passed over to rex in the background and logs errors if they occure.