aboutsummaryrefslogtreecommitdiff
path: root/TODO
blob: 142a7bbbde870747bacb7994695f2a4e474d9ff2 (plain)
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
81
# -- BUGS -- #
- /path/ is not recognized as configured, when only /path explicitly is
  configured.
- After a failure, the .backup directory is in a bad state (contains backup
  data labeled as old, however not related to the destination).

# -- TODO -- #
- For ssh, set up one single connection (maybe configurable?).
 `- ssh -oControlPath=/tmp/root-readable/something.sock \
        -oControlMaster=yes \
        -oControlPersist $remote /bin/true
 `- ssh -oControlPath=/tmp/root-readable/something.sock
- Set up default configuration file.
- [consider] When installing, copy the config file to both /etc and
  /usr/share, such that sourcing from the latter location removes the need to
  specify default options in the script itself.
- Test for read/write access at some point.
- Use autotools.
- Per dirpath rsync_args.
- Allow for resuming of backups.
 `- See rsync flags
   `- --ignore-existing
     `- Not a good idea if a notable amount of time passed.
     `- [question] What happens in case of partially transferred files?
   `- --delete-during, --delete-excluded
- [consider] Shell completion of configured backup paths.
- Better error handling on failure (of rsync).
- Use ask().
 `- Allow for configuration of default answer.
- [consider] Create subdirectories per year and/or month.
- [consider] Get date on source host.
- Named backups to allow for different destinations per source (and shorter
  names).
- Test suite.
- Check for several file systems in a tree (and error upon locating such).
- [consider] Add fallback if no local mirror of the source file tree is
  available.
- Only store the last mirror locally, but date it.
- [consider] --one-file-system as default option.

# -- PROBLEMS -- #
- rsync bug: https://bugzilla.samba.org/show_bug.cgi?id=13445
- Permissions.
 `- Suppress error output by 2>/dev/null.
 `- Save errors in a var by 'var="`cmd 2>&1`"'.
 `- Better: Print different error-text (test $? -gt 0).
 `- Or: Simply leave it as is.
 `- Best(?): test -r (read access)
- No read-access
 `- to $bakpath/...
 `- to $dirpath/...
 `- Solutions similar to 'permissions' above.
- No write access to $dirpath/...
 `- Maybe check by running chown / test -w.
   `- Should return errors if not possible.
   `- One could offer an exit option to the user
   `- or auto fix using sudo.

# -- IDEAS -- #
- colorized Output.
 `- optional (-c)
- Use Hexadecimal numbers for by_number.
- Verbosity option.
 `- For now, -v or -vv in rsync_args should work fine.
- non-intercative option.
- rsync_network_options (when remote src or dest, e.g. for --compress).
- Write metadata.
- Use wrappers for the functions possibly non locally executed.
- Compare src:work/$old_date and dest:$old_date for consistency.
- Run script instead of function remotely
 `- ssh host 'bash -s' -- < script_file args
 `- In case of dependencies, the otherwise sourced files could just be
    included in the stdin of ssh.
   `- cat script_file dep_file | ssh host 'bash -s' -- args
- Use stdout of functions to return a string value and stderr for everything
  else.
 `- Optional: Prefixes determining whether normal or error.
   `- Convert at the end (remove prefix and pipe to stderr / stdout).
- Only keep the respectively latest backup on the source.
 `- Or the last two, which would allow to reuse the second-last as new
    mirror (for a probably negligible gain, if any).