Backup Tools
There area a set of command line tools that automate common tasks in Tech Support called tstools. The latest version can be fould at http://tsbsackup/tstools.tar.gz. Download and extract the file:
tar -xvzf tstools.tar.gz
They can be run by cd-ing into the directory and running ./command. e.g.
cd tstools_package ./ts_identify
The main tools of interest are ts_network_backup
which automates the backup process, and ts_identify_backup
which identifies a backup directory given a ticket number.
Anything that ends in .sh or .cfg is not a command and should be ignored (do not delete these as they are used by other files).
All commands come with a built in help system that can be accessed with the -h option.
(As it is rather long the help section for ts_network_backup is included below).
The following tools work only with Ubuntu 10.04 at present:
ts_reset_gnome, ts_reset_panel, ts_reset_windowmanager
The following have been obsoleted by changed procedures, to some extent, but may be useful on odd occasions:
ts_login_as_user, ts_make_tsuser, ts_revert_passwords
Help for ts_network_backup
Use this to create or restore network backups. By default it will attempt to restore users, their data and settings, and the progams installed on the machine.
For a standard backup
ts_network_backup -c [TICKET NO]
to backup is sufficient.
To restore first identify the backup folder:
ts_identify [TICKET NO]
this will return the backup folder, then run
ts_network_backup -r [BACKUP_FOLDER]
to perform the restore.
N.B. on tsdata you MUST use the -p option to specify the path to the mounted disc.
Usage: ts_network_backup [OPTION(S)] Create or restore network backup. By default it backs up the contents of /home, the users on the system and the packages that have been installed (via apt-get, Ubuntu Software Center etc). -h Prints this message -c [ticket number] Create network backup -r [backup directory] Restore network backup. The backup directory should be in the format date-ticket_number. -d Data only. Does not backup/restore users or packages. Use of this option is strongly discouraged. -u Users and data only. Does not backup/restore packages. Use of this option is discouraged. -l [log file] Log messages to file rather than stdout. Be careful not to use the same path for backing up and restoring, or the log file may get overwritten. -t [addendum] Normally this script checks to see if a ticket number looks like a "real" ticket number. (i.e. it has the correct number of numbers). This option lets you add things to this number. It's useful if you are backing up more than one computer and want to store them in different folders referring to the same ticket. e.g. 00001-A and 00001-B Takes letters, numbers and _only. - is added automatically. -a /path/to/directory Alternative directory to backup. Implies -d i.e. does not backup users or packages. Use this if you want to backup something other than the home directory. e.g. an external windows drive. Suggests the use of -A for restoring backups. -f force the backup of a single file rather than a directory -F Force the overwriting an existing backup or restoring with -A and not -d -A /path/to/directory Use this to restore the backup to somewhere other than /home Can be used with or without -u or -d, suggests the later (required if needed) -F must be used if -d isn't. -p /path/to/home Use this if the home folder you want to backup is not in its usual place i.e. if you to backup an external/mounted drive rather than /home. You do not need to add home on the end but the script does not mind either way. Can be used with or without -u or -d.