Difference between revisions of "Backup Tools"

From FreekiWiki
Jump to navigation Jump to search
m
Line 19: Line 19:
 
The following have been obsoleted by changed procedures, to some extent, but may be useful on odd occasions:
 
The following have been obsoleted by changed procedures, to some extent, but may be useful on odd occasions:
 
<code>ts_login_as_user, ts_make_tsuser, ts_revert_passwords</code>
 
<code>ts_login_as_user, ts_make_tsuser, ts_revert_passwords</code>
 
 
 
 
  
  
Line 46: Line 42:
 
to perform the restore.
 
to perform the restore.
  
N.B. on the backup rack  you MUST use the -p option to specify the path to the mounted disc.
+
N.B. on the backup rack  you MUST use the -p or -a option to specify the path to the mounted disc.
 
 
 
 
 
<pre>
 
<pre>
  
Line 109: Line 103:
 
</pre>
 
</pre>
  
 +
 +
== Examples ==
 +
Backup an externally mounted drive mounted at /mnt/. Do not backup any programs.
 +
 +
<code>ts_network_backup -c 99999 -p /mnt -u</code>
 +
 +
Backup an externally mounted windows drive mountted at /media/win
 +
 +
<code>ts_network_backup -c 99999 -a '/media/win/Users and Settings'</code>
 +
 +
Back up from the first  of multiple  dd images
 +
 +
<code>ts_network_backup -c 99999 -a '/mnt/dd' -R -t A</code>
 
[[Category: Tech support]]
 
[[Category: Tech support]]

Revision as of 15:27, 18 May 2013

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://tsbackup/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_backups

The main tools of interest are ts_network_backup which automates the backup process, and ts_identify_backups 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 the backup rack you MUST use the -p or -a 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 
        -R                      Read only file system.
                                Use this if you are backing up a read only file
                                system e.g. form a dd image
                                This prevents the backup process from writing files
                                prior to backup. if used without -a it adds an
                                implicit -d. -a normally writes a file to the backup
                                listing the directory backed up. This is skipped.
	-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. 	


Examples

Backup an externally mounted drive mounted at /mnt/. Do not backup any programs.

ts_network_backup -c 99999 -p /mnt -u

Backup an externally mounted windows drive mountted at /media/win

ts_network_backup -c 99999 -a '/media/win/Users and Settings'

Back up from the first of multiple dd images

ts_network_backup -c 99999 -a '/mnt/dd' -R -t A