Commit 9f6abd79 authored by bescoto's avatar bescoto

Created new examples file for inclusion in distribution


git-svn-id: http://svn.savannah.nongnu.org/svn/rdiff-backup@426 2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109
parent 3930181e
...@@ -16,6 +16,9 @@ exiting with error. ...@@ -16,6 +16,9 @@ exiting with error.
Fixed problems with --restrict options that would cause proper Fixed problems with --restrict options that would cause proper
sessions to fail. Thanks to Randall Nortman for error report. sessions to fail. Thanks to Randall Nortman for error report.
File examples.html added to distribution; examples section removed
from man page.
New in v0.12.3 (2003/08/08) New in v0.12.3 (2003/08/08)
--------------------------- ---------------------------
...@@ -35,6 +38,7 @@ probably upgrade. Much thanks to Donovan Baarda for all the work that ...@@ -35,6 +38,7 @@ probably upgrade. Much thanks to Donovan Baarda for all the work that
went into this release. went into this release.
New in v0.12.2 (2003/07/24) New in v0.12.2 (2003/07/24)
--------------------------- ---------------------------
......
...@@ -24,37 +24,42 @@ def CopyMan(destination, version): ...@@ -24,37 +24,42 @@ def CopyMan(destination, version):
fp.close() fp.close()
infp.close() infp.close()
def MakeFAQ(): def MakeHTML(input_prefix, title):
"""Create FAQ.html and FAQ.wml files from FAQ-body.html""" """Create html and wml versions from given html body
faqbody_fp = open("FAQ-body.html", "r")
faqbody_string = faqbody_fp.read()
faqbody_fp.close()
wml_fp = open("FAQ.wml", "w") Input expected in <input_prefix>-body.html, and output will be put
in <input_prefix>.wml and <input_prefix>.html.
"""
body_fp = open("%s-body.html" % (input_prefix,), "r")
body_string = body_fp.read()
body_fp.close()
wml_fp = open("%s.wml" % (input_prefix,), "w")
wml_fp.write( wml_fp.write(
"""#include 'template.wml' home=. curpage=faq title="rdiff-backup: FAQ" """#include 'template.wml' home=. curpage=none title="%s"
<divert body> <divert body>
<p><h2>FAQ:</h2> <p><h2>%s</h2>
""") """ % (title, title))
wml_fp.write(faqbody_string) wml_fp.write(body_string)
wml_fp.write("\n</divert>\n") wml_fp.write("\n</divert>\n")
wml_fp.close() wml_fp.close()
html_fp = open("FAQ.html", "w") html_fp = open("%s.html" % (input_prefix,), "w")
html_fp.write( html_fp.write(
"""<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> """<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html> <html>
<head> <head>
<title>rdiff-backup FAQ</title> <title>%s</title>
</head> </head>
<body> <body>
<h1>rdiff-backup FAQ</h1> <h1>%s</h1>
""") """ % (title, title))
html_fp.write(faqbody_string) html_fp.write(body_string)
html_fp.write("\n</body></html>") html_fp.write("\n</body></html>")
html_fp.close() html_fp.close()
...@@ -82,7 +87,8 @@ def MakeTar(): ...@@ -82,7 +87,8 @@ def MakeTar():
os.system("rm -rf " + tardir) os.system("rm -rf " + tardir)
except OSError: pass except OSError: pass
os.mkdir(tardir) os.mkdir(tardir)
for filename in ["CHANGELOG", "COPYING", "README", "FAQ.html", for filename in ["CHANGELOG", "COPYING", "README",
"FAQ.html", "examples.html",
SourceDir + "/cmodule.c", SourceDir + "/cmodule.c",
SourceDir + "/_librsyncmodule.c", SourceDir + "/_librsyncmodule.c",
DistDir + "/setup.py"]: DistDir + "/setup.py"]:
...@@ -124,24 +130,25 @@ def parse_cmdline(arglist): ...@@ -124,24 +130,25 @@ def parse_cmdline(arglist):
"""Returns action""" """Returns action"""
global Version global Version
def error(): def error():
print "Syntax: makedist [--faq-only] [version_number]" print "Syntax: makedist [--html-only] [version_number]"
sys.exit(1) sys.exit(1)
optlist, args = getopt.getopt(arglist, "", ["faq-only"]) optlist, args = getopt.getopt(arglist, "", ["html-only"])
if len(args) != 1: error() if len(args) != 1: error()
else: Version = args[0] else: Version = args[0]
for opt, arg in optlist: for opt, arg in optlist:
if opt == "--faq-only": return "FAQ" if opt == "--html-only": return "HTML"
else: assert 0, "Bad argument" else: assert 0, "Bad argument"
return "All" return "All"
def Main(): def Main():
action = parse_cmdline(sys.argv[1:]) action = parse_cmdline(sys.argv[1:])
print "Making FAQ" print "Making HTML"
MakeFAQ() MakeHTML("FAQ", "rdiff-backup FAQ")
MakeHTML("examples", "rdiff-backup examples")
if action != "FAQ": if action != "HTML":
assert action == "All" assert action == "All"
print "Processing version " + Version print "Processing version " + Version
tarfile = MakeTar() tarfile = MakeTar()
......
...@@ -32,7 +32,7 @@ stored in a special subdirectory of that target directory, so you can ...@@ -32,7 +32,7 @@ stored in a special subdirectory of that target directory, so you can
still recover files lost some time ago. The idea is to combine the still recover files lost some time ago. The idea is to combine the
best features of a mirror and an incremental backup. rdiff-backup best features of a mirror and an incremental backup. rdiff-backup
also preserves symlinks, special files, hardlinks, permissions, also preserves symlinks, special files, hardlinks, permissions,
uid/gid ownership (if it is running as root), and modification times. uid/gid ownership, and modification times.
.B rdiff-backup .B rdiff-backup
can also operate can also operate
...@@ -53,6 +53,10 @@ except with rdiff-backup. Many of the increments are stored as ...@@ -53,6 +53,10 @@ except with rdiff-backup. Many of the increments are stored as
reverse diffs, so if you delete or modify a file, you may lose the reverse diffs, so if you delete or modify a file, you may lose the
ability to restore previous versions of that file. ability to restore previous versions of that file.
Finally, this man page is intended more as a precise description of
the behavior and syntax of rdiff-backup. New users may want to check
out the examples.html file included in the rdiff-backup distribution.
.SH OPTIONS .SH OPTIONS
.TP .TP
.B -b, --backup-mode .B -b, --backup-mode
...@@ -196,10 +200,12 @@ List the number and date of partial incremental backups contained in ...@@ -196,10 +200,12 @@ List the number and date of partial incremental backups contained in
the specified destination directory. No backup or restore will take the specified destination directory. No backup or restore will take
place if this option is given. place if this option is given.
.TP .TP
.B "-m, --mirror-only" .B --list-increment-sizes
Do not create an rdiff-backup-data directory or make any increments. List the total size of all the increment and mirror files by time.
In this mode rdiff-backup is similar to rsync (but usually This may be helpful in deciding how many increments to keep, and when
slower). to --remove-older-than. Specifying a subdirectory is allowable; then
only the sizes of the mirror and increments pertaining to that
subdirectory will be listed.
.TP .TP
.B --no-change-dir-inc-perms .B --no-change-dir-inc-perms
Do not change the permissions of the directory increments to match the Do not change the permissions of the directory increments to match the
...@@ -374,101 +380,6 @@ permissions, hard linking, or ownership. Use this when restoring from ...@@ -374,101 +380,6 @@ permissions, hard linking, or ownership. Use this when restoring from
an rdiff-backup directory on a windows file system to a unix file an rdiff-backup directory on a windows file system to a unix file
system. system.
.SH EXAMPLES
Simplest case---backup directory foo to directory bar, with increments
in bar/rdiff-backup-data:
.PP
.RS
rdiff-backup foo bar
.PP
.RE
This is exactly the same as previous example because trailing slashes
are ignored:
.PP
.RS
rdiff-backup foo/ bar/
.PP
.RE
Back files up from /home/bob to /mnt/backup, leaving increments in /mnt/backup/rdiff-backup-data. Do not back up directory /home/bob/tmp or any files in it.
.PP
.RS
rdiff-backup --exclude /home/bob/tmp /home/bob /mnt/backup
.PP
.RE
The file selection options can be combined in various ways. The
following command backs up the whole file system to /usr/local/backup.
However, the entire /usr directory is skipped, with the exception of
/usr/local, which is included, except for /usr/local/backup, which is
excluded to prevent a circularity:
.PP
.RS
rdiff-backup --exclude /usr/local/backup --include /usr/local --exclude /usr / /usr/local/backup
.PP
.RE
You can also use regular expressions in the --exclude statements.
This will skip any files whose full pathnames contain the word
"cache", or any files whose name is "tmp", "temp", "TMP", "tEmP", etc.
.PP
.RS
rdiff-backup --exclude-regexp cache --exclude-regexp '(?i)/te?mp$' /home/bob /mnt/backup
.PP
.RE
After the previous command was completed, this command will list the
backups present on the destination disk:
.PP
.RS
rdiff-backup --list-increments /mnt/backup
.PP
.RE
If space is running out on the /mnt/backup directory, older
incremental backups can be erased. The following command erases
backup information older than a week:
.PP
.RS
rdiff-backup --remove-older-than 7D /mnt/backup
.PP
.RE
The following reads the file
important-data.2001-07-15T04:09:38-07:00.dir and restores the
resulting directory important-data as it was on Februrary 14, 2001,
calling the new directory "temp". Note that rdiff-backup goes into
restore mode because it recognizes the suffix of the file. The -v9
means keep lots of logging information.
.PP
.RS
rdiff-backup -v9 important-data.2001-07-15T04:09:38-07:00.dir temp
.PP
.RE
This command causes rdiff-backup to backup the directory
/some/local-dir to the directory /whatever/remote-dir on the machine
hostname.net. It uses ssh to open the necessary pipe to the remote
copy of rdiff-backup. Here the username on the local machine and on
hostname.net are the same.
.PP
.RS
rdiff-backup /some/local-dir hostname.net::/whatever/remote-dir
.PP
.RE
This command logs into hostname.net as smith and restores the remote
increment old-file on a remote computer to the current directory on
the local computer:
.PP
.RS
rdiff-backup smith@hostname.net::/foo/rdiff-backup-data/increments/bar/old-file.2001-11-09T12:43:53-04:00.diff
.PP
.RE
Backup foo on one remote machine to bar on another. This will
probably be slower than running rdiff-backup from either machine.
.PP
.RS
rdiff-backup smith@host1::foo jones@host2::bar
.PP
.RE
Test to see if the specified ssh command really opens up a working
rdiff-backup server on the remote side.
.RS
rdiff-backup --test-server hostname.net::/ignored
.SH RESTORING .SH RESTORING
There are two ways to tell rdiff-backup to restore a file or There are two ways to tell rdiff-backup to restore a file or
directory. Firstly, you can run rdiff-backup on a mirror file and use directory. Firstly, you can run rdiff-backup on a mirror file and use
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment