> # Verify source is up and accepting connections before deleting any old backups
> rsync "$source" >/dev/null || _exit_err "Source ${source} is not readable. Skipping."
I think that this quick test is a much better than, say, pinging
the source in a pre-exec script: this tests not only that the
source is up and connected to the net, it also verifies (1) that
ssh is up and accepting our key (if we are using ssh), and (2) that
the source directory is mounted (if it needs to be mounted) and
readable.
Bug description:
From: Tiziano Müller <dev-zero@g.o>
Subject: Notiz: Probleme mit Ampersand in source
Date: Tue, 07 Oct 2008 16:11:10 +0000
Hoi Nico
Kleine Notiz wie im IRC besprochen:
- Hat es in /etc/ccollect/sources/$BACKUPNAME/source ein Ampersand muss
dieses Escaped werden, da sonst folgender Fehler auftritt:
*snip*
[volumes_ForschungEntwicklung] 2008-10-05-03:10:03: Beginning to backup,
this may take some time...
[volumes_ForschungEntwicklung] 2008-10-05-03:10:03:
Creating /home/backup/volumes/Forschung&Entwicklung/daily.20081005-0310.15173 ...
[volumes_ForschungEntwicklung] 2008-10-05-03:10:03: Transferring
files...
[volumes_ForschungEntwicklung] bash: Entwicklung/*: No such file or
directory
[volumes_ForschungEntwicklung] rsync: connection unexpectedly closed (4
bytes received so far) [receiver]
[volumes_ForschungEntwicklung] rsync error: error in rsync protocol data
stream (code 12) at io.c(635) [receiver=3.0.2]
[volumes_ForschungEntwicklung] 2008-10-05-03:10:03: Finished backup
(rsync return code: 12).
[volumes_ForschungEntwicklung] 2008-10-05-03:10:03: Warning: rsync
exited non-zero, the backup may be broken (see rsync errors).
*snip*
- ein "&" im Namen fürs Backup,
also: /etc/ccollect/sources/volumes_Forschung&Entwicklung/ wird beim
Anzeigen (wie oben zu sehen) verschluckt.
Cheers,
Tiziano
Signed-off-by: Nico Schottelius <nico@ikn.schottelius.org>
1. I got a syntax error in ccollect.sh once in a while, i think at
rollover. I changed the line
j=$((j+1))
to
j=$(($j+1))
(twice) and the error went away.
But this is definitly the WRONG way.
We cannot, we need not and we MUST NOT try to catch dumb users.
Instead we are the program, we may give the rules. And if we add a fancy
feature and the user is too dumb to use it, it is HER/HIS fault.
Just to remind my self:
Add use of other backup intervals as source for this interval
with the following behaviour:
- locate all possible intervals in
* default configuration
* source specific configuration
- locate all backups for each interval, record only the timestamp:
* taeglich.2007-01-23-0042
-> possible_old_sources += taeglich
-> taeglich_last=2007-01-23-0042
- NO READ NEED for this! other method:
* sort by time, ALL possible backup:
- does posix-ls support this? CHECK!
- ( cd $C_SOURCE/destination/;
ls --sort-by-time "$interval1".* "$interval2".* |
tail -n1 )
- catches all possible intervals
- add optional behaviour:
* prefer other interval (newer) over this one
Added more generated dac to .gitignore
Added changing permissions on webserver
Fixed bug when user specifies "ccollect interval source/"
(If a user has a ":" in its path he should be shoot).
Added note to new documentation.
Pre_exec has to be executed first, because it may create other
configuration options (including mounting the destination!)
(the problem was reported by Tonnerre Lombard).
Also added more beautiful comments.