Difference between revisions of "Backup Tools"

From FreekiWiki
Jump to navigation Jump to search
 
Line 4: Line 4:
 
They can be run  by cd-ing into the directory and running ./command. e.g.
 
They can be run  by cd-ing into the directory and running ./command. e.g.
 
     cd  tstools_package
 
     cd  tstools_package
     ./ts_network_backup
+
     ./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.
+
The main tools of interest are''' <code>ts_network_backup</code>''' which automates the backup process, and '''<code>ts_identify_backup</code>''' 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).
+
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.
 
All commands come with a built in help system that can be accessed with the -h option.
Line 15: Line 15:
  
 
The following tools work only with Ubuntu 10.04 at present:
 
The following tools work only with Ubuntu 10.04 at present:
ts_reset_gnome, ts_reset_panel, ts_reset_windowmanager
+
<code> ts_reset_gnome, ts_reset_panel, ts_reset_windowmanager</code>
  
 
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:
ts_login_as_user, ts_make_tsuser, ts_revert_passwords
+
<code>ts_login_as_user, ts_make_tsuser, ts_revert_passwords</code>
  
================================================================================
 
  
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 reurn the backup folderm, then
+
 
ts_network_backup -r [BACKUP_FOLDER].
+
== 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.
 
N.B. on tsdata you MUST use the -p option to specify the path to the mounted disc.
  
  
Help for ts_network_backup
+
<pre>
===========================
+
 
 
Usage: ts_network_backup  [OPTION(S)]
 
Usage: ts_network_backup  [OPTION(S)]
 
Create or restore network backup.  
 
Create or restore network backup.  
Line 41: Line 59:
 
         -h              Prints this message
 
         -h              Prints this message
 
         -c [ticket number] Create network backup
 
         -c [ticket number] Create network backup
-r [backup directory] Restore network backup. The backup directory  
+
        -r [backup directory] Restore network backup. The backup directory
should be in the format date-ticket_number.
+
        should be in the format date-ticket_number.
-d Data only. Does not backup/restore users or  
+
-d Data only. Does not backup/restore users or
packages.
+
        packages.
 
Use of this option is strongly discouraged.
 
Use of this option is strongly discouraged.
 
-u Users and data only. Does not backup/restore  
 
-u Users and data only. Does not backup/restore  
Line 51: Line 69:
 
-l [log file] Log messages to file rather than stdout.
 
-l [log file] Log messages to file rather than stdout.
 
Be careful not to use the same path for backing
 
Be careful not to use the same path for backing
up and restoring, or the  log file may get  
+
up and restoring, or the  log file may get overwritten.
overwritten.
 
 
-t [addendum] Normally this script checks to see if a ticket
 
-t [addendum] Normally this script checks to see if a ticket
 
number looks like a "real" ticket number.  
 
number looks like a "real" ticket number.  
Line 83: Line 100:
 
script does not mind either way.  
 
script does not mind either way.  
 
Can be used with or without -u or -d.
 
Can be used with or without -u or -d.
+
</pre>
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.
 

Revision as of 15:01, 14 February 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://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.