Differences

This shows you the differences between the selected revision and the current version of the page.

lcd_manual 2009/10/30 21:08 lcd_manual 2010/06/23 19:36 current
Line 1: Line 1:
====== lcd manual ====== ====== lcd manual ======
- 
===== About ===== ===== About =====
The 'lcd' command allows you to move forward and backwards though time in a similar way to using the built-in cd directory to change your current working directory. Essentially, the 'lcd' command moved your directory into a more recent or less recent backup snapshot but keeps your relative position within the snapshot if possible. The 'lcd' command allows you to move forward and backwards though time in a similar way to using the built-in cd directory to change your current working directory. Essentially, the 'lcd' command moved your directory into a more recent or less recent backup snapshot but keeps your relative position within the snapshot if possible.
 +
 +\\
 +[[screencasts|{{screencast_logo_small_padding.png|}}]]\\
 +  * //[[screencasts|Watch a video introduction to the lcd command]].//
 +\\
===== When to Use ===== ===== When to Use =====
-If you are searching for a file then you can move forwards or backwards though time with this command to find the file you wish to locate in the backup set. This tool could also provide the basis of a more advanced tools which would scan forward or backwards for changes to a particular file or directory.+If you are searching for a file then you may move forwards or backwards though time using the 'lcd' to find the file you wish to locate within your backup set(s). This tool also provide the basis of more advanced tools which could potentially scan forward or backwards for changes to a particular file or directory.
===== Usage Examples ===== ===== Usage Examples =====
Line 37: Line 41:
\\ \\ \\ \\
-====== Helpful Links ====== +===== Scripting with LCD ===== 
- * [[Command Line Tools]] +It is possible to create scripts which call the 'lcd' command and search though within your backup set(s) for specific files, changes in files or for directly listing changes (eg. renaming of a file, deletion of a file, etc.)  
- * [[Documentation]] +\\  
- * [[Mailing Lists]]+In order to use the 'lcd' command from within a script you must be running LBackup 0.9.8r4-alpha9 or later. In addition, you will need to pass the '-s' flag to the lcd command when invoked within a script. Below there is a basic example script listed along with the scripts output :
 +\\
 +==== Sample Script ====
 +=== Sample Script Listing ===
 +<file>
 +#!/bin/bash
 +cd /tmp/dst/Section.3/src
 +pwd
 +ls -l
 +echo "moving to a more recent backup"
 +. /usr/local/sbin/lcd -s future
 +pwd
 +echo "moving to a more recent backup"
 +. /usr/local/sbin/lcd -s future
 +pwd
 +
 +echo "moving back to an older backup"
 +source /usr/local/sbin/lcd -s past
 +pwd
 +ls
 +
 +exit 0
 +
 +</file>
 +
 +=== Sample Script Output ===
 +
 +Output from running the test script, assuming you have a backup set located at the following path : '/tmp/dst/'
 +
 +<file>
 +/tmp/lcd_test.bash
 +/private/tmp/dst/Section.3/src
 +total 8
 +drwxr-xr-x@ 4 lbackup  wheel  136 Jun 18 10:28 Adium.app
 +-rw-rw-r--@ 7 lbackup  wheel  2620 Jan  6 14:37 README.TXT
 +moving to a more recent backup
 +/private/tmp/dst/Section.2/src
 +moving to a more recent backup
 +/private/tmp/dst/Section.1/src
 +moving three to an older backup
 +/private/tmp/dst/Section.2/src
 +Adium.app README.TXT
 +</file>
 +
 +\\ \\
 +
 +
 +====== Helpful Links ======
 +  * [[Command Line Tools]]
 +  * [[Documentation]]
 +  * [[Mailing Lists]]