my first attempt at checking exit codes. Do things l00k right?
my first attempt at checking exit codes. Do things l00k right?
Well, I've tested and I'm getting err0rs. :/
my first attempt at checking exit codes. Do things l00k right?
Well, I've tested and I'm getting err0rs. :/
./backup.sh: line 6: [: retVal: integer expression expected
./backup.sh: line 12: [: retVal: integer expression expected
./backup.sh: line 18: [: retVal: integer expression expected
Try setting retVal after running the rsync, $? is only populated on Me>completion either successfully "0" or failure "1-127" of any command.
So, you need really;
rsync blah blah
retVal=$?
do some stuff...
if [[ $retVal -gt 0 ]]; then
# some stuff happened but it failed
else
Also, you're defining use of /bin/bash as your shebang, but using posix
if statements.
if using bash, if should be;
if [[ $var -gt 0 ]]; then
if using posix, if should be;
if [ $var -gt 0 ]; then
I use Bacula for all of my backups at home, and have used it to back up entire corporate enterprises. It will do everything you need - rotating your backups, restoring, messagine, reporting, etc - its a very good and fully featured open source backup utility. It backs up all the games I host, databases, etc. I think you like Debian and there are certainly packages for it. Bacula has 3 components to it: manager, storage daemon (where your backups go) and file daemon (the client).
I use Bacula for all of my backups at home, and have used it to back up entire corporate enterprises. It will do everything you need - rotating your
it. Bacula has 3 components to it: manager, storage daemon (where your backups go) and file daemon (the client).
Nice - I went with PBS in the end, but will take a peek at Bacula - it sounds light and full featured. Thanks for sharing. :P
I think the days of having a "server" and "manager" for back up are
coming to an end.
I think the days of having a "server" and "manager" for back up are coming to an end.
are just recreating this. By all means, do it your way if it works for you, but to say this is "coming to an end" is inaccurate.
I use Bacula for all of my backups at home, and have used it to
back up entire corporate enterprises. It will do everything you
need - rotating your backups, restoring, messagine, reporting,
etc - its a very good and fully featured open source backup
utility. It backs up all the games I host, databases, etc. I
think you like Debian and there are certainly packages for it.
Bacula has 3 components to it: manager, storage daemon (where
your backups go) and file daemon (the client).
Nice - I went with PBS in the end, but will take a peek at Bacula - it sounds light and full featured. Thanks for sharing. :P
telnet://bbs.roonsbbs.hu:1212 <<=-
Actually, I understand that you have a view that you dont agree with me.
I work in the business of protecting enterprise data and have done for many years, so I do think it is accurate (hence why I mentioned it).
I see what clients are asking for, and the legacy "backup server" and "backup client" is not as popular as it was 20+ years ago.
When I look at alternative backup technologies, I *can* see that the "backup server" is less of a requirement today than it was, because
there now exists new storage technologies that change the architecture
and cost of having said architecture, but still deliver on the requirements.
True, enterprise scheduling, as is scalability is a requirement, and
there are strong technologies in that space as well, that organisations are using anyway outside of "backup and recovery".
1. Try to write POSIX compliant scripts those don't depend on Bash. Use checkbashisms to check whether you are using any Bash-only features.
Then you can safely use the #!/bin/sh shebang. (Unless you really need some Bash features, but then you should declare that your script
requires Bash with the #!/bin/bash shebang. Unlikely you'll need Bash
for a backup script)
2. Use shellcheck to validate your code. It helps you point out gotchas you might not think of.
3. This is just my taste, but for FS I need regular backups from, I'd prefer to use BTRFS, then my script would make a snapshot of the
subvolume and transfer it to another disk via the btrfs send command.
Not only it would be more error-prone(as an entire subvolume would be transferred differentially (in case you use -p to specify your previous snapshot to use as a base) which either fails or succeeds, but you could save previous states of your files snapshotted at specific points in
time without using significantly more disk space.
4. If I can't use BTRFS but need differential archives, I prefer to use DAR.
Sysop: | CyberNix |
---|---|
Location: | London, UK |
Users: | 22 |
Nodes: | 10 (0 / 10) |
Uptime: | 41:30:11 |
Calls: | 903 |
Files: | 4,773 |
Messages: | 715,590 |