How to backup before a release upgrade from Ubuntu 18.04.5 LTS server?

Chris Green cl at isbd.net
Sun Sep 26 11:53:04 UTC 2021


On Sun, Sep 26, 2021 at 01:17:49PM +0200, Bo Berglund wrote:
> On Sun, 12 Sep 2021 18:46:10 +0200, Ralf Mardorf via ubuntu-users
> <ubuntu-users at lists.ubuntu.com> wrote:
> 
> >On Sun, 12 Sep 2021 14:52:20 +0200, Bo Berglund wrote:
> >>I just have to figure out how to exclude certain directories from the
> >>backup.
> >>
> >>And what happens with stuff that has been symlinked to two places like
> >>my www dir, will it be copied from both places then making the archive
> >>twice as big?
> >>
> >>And why the need to shut down the server and boot it with installation
> >>media?
> >
> >Hi,
> >
> >tar provides to "exclude" patterns, but IMO those are tricky to use, my
> >recommendation is not to use an "exclude" pattern, unless you really
> >know what you are doing.
> >
> >The good news, tar doesn't follow symlinks, it just backups the symlink
> >file.
> >
> >The shutdown is needed, because you cannot lock everything, so if you
> >backup a running system, you backup a system in different
> >(probably inconsistent) states. 
> >
> >The successors of the AT&T UNIX "dump" utility can make a backup of a
> >file system in progress, if the file system provides to do snapshots.
> >
> >I'm a litle bit confused, since
> >http://manpages.ubuntu.com/manpages/bionic/man8/dump.8.html claims
> >"dump - ext2/3/4 filesystem backup".
> >
> >https://en.wikipedia.org/wiki/Snapshot_(computer_storage)
> >
> 
> So now I have explored a number of alternatives and found most to be very
> complicated to use...
> 
> It seems like rsync would be my best bet and then I have a couple of questions
> concerning the rsync handling:
> 
> 1) How does rsync treat symlinks?
> Does rsync just copy the link itself or does it try to follow into the linked
> directory tree too? If it does than how do I switch that off?
> It makes no sense to copy a set of files twice...
> I have a huge file tree below $HOME/www which is symlinked into the Apache
> /var/... start and this should not be copied twice!
> 
There is a whole raft of options in rsync to determine how it handles
symlinks, read the man page.


> 2) Using --exclude-from option, where is the file located?
> I understand that I can specify the excludes to be read from file this way, but
> I have yet to figure out where to place the exclude spec file.

Where you want, the =FILE tells rsync where you have put the file, you
probably should use an absolute path to the file to guarantee that
rsync always finds it.  If you don't give it an absolute path then I
think it will be relative to the directory from which you're running
rsync.


> Is there such a file in *every* dir or can I specify the absolute path to the
> file (rsync seems generally not to want absolute paths).
> Or must it be in the current dir when rsync is launched, how do I specify that
> if I run rsync from cron???
> 
There's a different option for doing this, such that you can put a
file accept/reject specification in the directory that it applies to.
Look at the --filter and -F options.

-- 
Chris Green




More information about the ubuntu-users mailing list