Page 1 of 3 123 LastLast
Results 1 to 10 of 21

Thread: What to backup

  1. #1

    Default What to backup

    Dear all,
    I would like to ask you something concenring backup (placed the post here, as I think believe that backup is something that has to do with the installation of a new system).


    I use Yast to backup the following folders

    /home/myuser
    /etc

    what others should I add ?

    Regards
    Alex

  2. #2
    Join Date
    Jun 2008
    Location
    The English Lake District. UK - GMT/BST
    Posts
    36,734
    Blog Entries
    20

    Default Re: What to backup

    Personally on a 'Personal' machine.I only backup personal files. Manually.
    Leap 15.1_KDE
    My Articles Was I any help? If yes: Click the star below

  3. #3
    Join Date
    Jun 2008
    Location
    Netherlands
    Posts
    25,369

    Default Re: What to backup

    A backup of /etc is not a bad idea imho, you have then most of the systems configuration files, which might be handy when recreating the system after a reinstall.
    And of course /home (or whe you have but one user the same as you do).

    The rest depends on the systems functionality (webserver: /srv, database: special database backup, etc).
    Henk van Velden

  4. #4

    Default Re: What to backup

    I backup everything except /tmp and of course swap and I think dev. If you do a default install and do not change it then backing up /home may be sufficient. If you are always rebuilding even a complex system and have automated the build then backing up /home may be sufficient. If you do an initial install and then add additional software, run servers such as samba, customize the login process, replace default packages with packages from packman, etc then I would backup everything. Assuming that your data is in /home then / is not large. It is likely to be < 20GB and can be restored much more quickly than you can install opensuse. If you have any volume of data in /home or additional file systems then the additional time and space taken to backup the full system is minimal.

    Whatever you choose to backup, make sure that you can restore your backup.

  5. #5
    Join Date
    Jul 2008
    Location
    Seattle, WA
    Posts
    17,079

    Default Re: What to backup

    On Thu, 10 Mar 2011 16:36:02 +0000, hcvv wrote:

    > A backup of- /etc -is not a bad idea imho, you have then most of the
    > systems configuration files, which might be handy when recreating the
    > system after a reinstall.
    > And of course -/home- (or whe you have but one user the same as you do).
    >
    > The rest depends on the systems functionality (webserver: -/srv-,
    > database: special database backup, etc).


    I'd also be inclined to tuck a copy of the output from:

    rpm -qa

    in a file somewhere.

    Jim

    --
    Jim Henderson
    openSUSE Forums Administrator
    Forum Use Terms & Conditions at http://tinyurl.com/openSUSE-T-C

  6. #6
    Join Date
    Jun 2008
    Location
    Netherlands
    Posts
    25,369

    Default Re: What to backup

    Quote Originally Posted by hendersj View Post
    I'd also be inclined to tuck a copy of the output from:

    rpm -qa

    in a file somewhere.

    Jim

    --
    Jim Henderson
    O yes, good idea. And a copy of fdisk -l as I suggested in annother thread. And may be more of these. And /boot/grub/menu.lst.
    In fact I have a package of about ten HTML pages with information for every system I manage. They contain configurations, etc. in a form more pleasing to the eye as well as copies of the plain text configuration files. And those web-pages are refreshed every week and put on an internal (to the LAN) web-site (that is backup-ed itself of course). Example page: Disk usage on the boven.henm.xs4all.nl
    Henk van Velden

  7. #7
    Join Date
    Jul 2008
    Location
    Seattle, WA
    Posts
    17,079

    Default Re: What to backup

    On Fri, 11 Mar 2011 09:06:03 +0000, hcvv wrote:

    > O yes, good idea. And a copy of -fdisk -l- as I suggested in annother
    > thread. And may be more of these. And -/boot/grub/menu.lst-. In fact I
    > have a package of about ten HTML pages with information for every system
    > I manage. They contain configurations, etc. in a form more pleasing to
    > the eye as well as copies of the plain text configuration files. And
    > those web-pages are refreshed every week and put on an internal (to the
    > LAN) web-site (that is backup-ed itself of course). Example page: 'Disk
    > usage on the boven.henm.xs4all.nl'
    > (http://www.xs4all.nl/~hcvv/mgi-schijven.html)


    Yep, those are all good things to include as well.

    Jim



    --
    Jim Henderson
    openSUSE Forums Administrator
    Forum Use Terms & Conditions at http://tinyurl.com/openSUSE-T-C

  8. #8

    Default Re: What to backup

    I will need to ask you something more.

    I configured my backups to run the first of every month (Yast Backup) and
    I would like the following script

    fdisk -l > /home/apb/partitions.txt
    cat /etc/fstab > /home/apb/fstab.txt
    rpm -qa > packagesinstalled.txt
    chown apb.user /home/apb/partitions.txt /home/apb/fstab.txt /home/apb/packagesinstalled.txt

    to run every first of the month before before yast's backup.

    How can I do that with cron, to guarantee that my script will run before yast's scheduled backup?

    I would like to thank you in advance for your help
    Regards
    Alex

  9. #9
    Join Date
    Jun 2008
    Location
    Netherlands
    Posts
    25,369

    Default Re: What to backup

    A few things about your setup are not clear to me.

    1) Who is supposed to run these statements? All of them need no root, thus I assume some user. Is that user apb? Then the output redirection of the first two statements go into the home directory of apb, and the output redirection of the last goes to the working directory, which, when started from apb's crontab, also his home directory. Why the difference?

    2) Who is user apb.user? Why do you change the ownerships of the created files from apb to apb.user?

    3) I should not put those files in the home directory of the user. When doing this with all sorts of files, a home directory will end up as one big dustbin. Organize things, thus create a directory inside the home directory (or even deeper).

    4) You end the name of all three file with the characters .txt. I hope you are aware of the fact that that is your personal choice, not something that is a "must" for whatever reason.

    5) Then make a script out of these statements by using an editor of your choice. I would put this in /home/apb/bin/ as this is a good place for it allready prepared for you by openSUSE (it is e.g. in your PATH environment variable). Give it a file name of your choice, I will use backup-some-systemfiles in my examples below

    6) Do not forget to start this file with the first line:
    Code:
    #!/bin/bash
    else it is no script, but just a bunch of statements. This will lead to someting like:
    Code:
    #!/bin/bash
    fdisk -l >/home/apb/partitions.txt
    cat /etc/fstab >/home/apb/fstab.txt
    rpm -qa >/home/apbpackagesinstalled.txt
    7) Make the script executable with:
    Code:
    chmod u+x /home/apb/bin/backup-some-systemfiles
    8) Make a crontab entry. In KDE there is a way to do that with a GUI in it's system configurations, but you could do that also from the CLI with:
    Code:
    crontab -e
    The line added to the crontab must be something like:
    Code:
    1 0 1 * * /home/apb/bin/backup-some-systemfiles
    that means that on minute 1 of hour 0 of day 1 of every month and irrespective of the day of the week the script /home/apb/bin/backup-some-systemfiles must be started. The only thing here is that I do not know at wat exact time your YaST backup is scheduled. But when it is in /etc/cron.monthly (please check), then it is started 15 minutes after the hour according to /etc/crontab:
    Code:
    boven:/etc # cat /etc/crontab
    SHELL=/bin/sh
    PATH=/usr/bin:/usr/sbin:/sbin:/bin:/usr/lib/news/bin
    MAILTO=root
    #
    # check scripts in cron.hourly, cron.daily, cron.weekly, and cron.monthly
    #
    -*/15 * * * *   root  test -x /usr/lib/cron/run-crons && /usr/lib/cron/run-crons >/dev/null 2>&1
    
    boven:/etc #
    and 14 minutes should be enough for your script.
    Henk van Velden

  10. #10
    Join Date
    Jul 2008
    Location
    Seattle, WA
    Posts
    17,079

    Default Re: What to backup

    On Tue, 15 Mar 2011 11:06:02 +0000, hcvv wrote:

    > All of them need no -root-,


    Well, 'fdisk -l' won't provide any input (at least it hasn't in my tests)
    unless it's run by root. But the others shouldn't require root
    permissions.

    Jim



    --
    Jim Henderson
    openSUSE Forums Administrator
    Forum Use Terms & Conditions at http://tinyurl.com/openSUSE-T-C

Page 1 of 3 123 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •