File: DESIGN

package info (click to toggle)
rdup 0.6.0-1
  • links: PTS, VCS
  • area: main
  • in suites: lenny
  • size: 784 kB
  • ctags: 108
  • sloc: sh: 3,225; ansic: 1,624; perl: 565; makefile: 65
file content (80 lines) | stat: -rw-r--r-- 2,428 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
/RDUP DESIGN DOC

1/ GOALS
        1) Keep it Simple
        2) Fast
        3) Small

2/ HIGH LEVEL

    Full dump:
        1) Crawl all directories, and print all the names found to
           standard output.
        2) Write a filelist with all the names found when crawling.
           Use this list to calculate the correct incremental dump.

    Incremental dump:
        1) Read in the filelist that was written when doing a full dump.
        2) Crawl all the directories again.
        3) Diff 1) and 2) to get two lists; one of removed items and one
           of added/modified items.
        4) Write the removed items to standard output
        5) Write the modified/new items to standard output.
        6) Write a new filelist.
        7) Touch the timestamp file

3/ C FILES
crawler.c
        The crawler recursively decends into directories.

        Each found item (file, symlink or directory) is placed into a GTree
        with a value of VALUE (only the keys are used by rdup).

        When a .nobackup is found the entry's value is changed from
        VALUE to NO_PRINT. The functions that write the list know that
        NO_PRINT values should not be written nor printed.  (The entry
        could not simple be removed, becaused that messes up the flow of
        the GTree).

        So in rdup each item (a path) can have three values:
        NULL     
                initial value, used by GTree to signal 'not found'.
        VALUE 
                rdup uses this to differentiate between 'not found' and
                found items.
        NO_PRINT 
                don't print items with these values.

gfunc.c
        This file contains all functions that operate on GTrees.

getdelim.c  
        A getdelim() implementation for systems that don't have the GNU
        one.

rdup.c 
	Contains main() and a few functions that perform the
	initialization. Also reads and writes the internal filelist.

signal.c
        Contains a signal handling function.

regex.c
        Regular expression functions.

xattr.c
        Extended attributes functions.

sha1.c
        SHA-1 implementation, for file hashing.

4/ UTILITIES

A reference implementation of some backup and restore utilities is
included. 

All scripts share a simular setup: 
   o Parse the output from rdup
   o Check whether the current line is a directory, link or file
   o Act accordingly
   o Continue with next line or EOF