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).
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 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.
> 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:
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
> 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.
A few things about your setup are not clear to me.
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?
Who is user apb.user? Why do you change the ownerships of the created files from apb to apb.user?
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).
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.
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
Do not forget to start this file with the first line:
#!/bin/bash
else it is no script, but just a bunch of statements. This will lead to someting like:
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:
crontab -e
The line added to the crontab must be something like:
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:
You are right, /dev/sda, etc. are not world readable.
Thus the script should be created and owned by root and put in /root/bin. And in root’s crontab, or the system crontab, or even direct in /etc/cron.monthly. Depends on where the backup crontab entry is.
Would autoyast be a possible solution here? IIRC, the autoyast file can contain partition layouts and a list of installed software.
Personal data would still need to backed up on a regular basis.
If you needed to rebuild your system all you would need is the install media and the autoyast file.
Once the system has been rebuilt all you would have to do is restore your personal data…
On 2011-03-16 04:06, jthiatt08 wrote:
>
> Would autoyast be a possible solution here? IIRC, the autoyast file can
> contain partition layouts and a list of installed software.
> Personal data would still need to backed up on a regular basis.
> If you needed to rebuild your system all you would need is the install
> media and the autoyast file.
> Once the system has been rebuilt all you would have to do is restore
> your personal data…
>
> Sounds good in theory, right?
For that purpose, use yast backup. It creates an autoyast file, plus any
changed file from installed rpms. It does not include new files, AFAIK.
–
Cheers / Saludos,
Carlos E. R.
(from 11.2 x86_64 “Emerald” at Telcontar)
Well okay I do not know what yast backup creates. I will try it today and see. I am just thinking that it will be possible to find my /home directory compressed and thus a normal decompress will fix a corrupted system or at least have all my document files in a new installation.
Back to the other business now…
I created the following script inside my /root folder
I made it executable and seems to work okay.
I also added this in crotab -e
10 0 1 * * /root/backup/backup.sh
as I want to run the backup at 10:00 am the first day of every month.
I also configured Yast to run at 11 am the first day of every month.
The problem now is that I can not see anything under /etc/cron.monthly. I was expecting there to be my script that runs at 10 am and an entry from Yast that runs at 11.
What should I do for that?>?
As I want to backup in an external hard disk is it possible when the system boots up to raise a warning (or halt system boot up , pressing a button will resume it of course) with “First of Month, Plug in your hard disk and mount it so the yast backup will work correct”
> The problem now is that I can not see anything under /etc/cron.monthly.
> I was expecting there to be my script that runs at 10 am and an entry
> from Yast that runs at 11.
Wrong expectation
You can create a normal script and place it in /etc/cron.monthly, and it
will for sure run once a month, but you can’t ensure nor the hour nor the
day. This is designed for systems that are not running 24*7.
>
> 1) What should I do for that?>?
>
> 2) As I want to backup in an external hard disk is it possible when
> the system boots up to raise a warning (or halt system boot up ,
> pressing a button will resume it of course) with “First of Month, Plug
> in your hard disk and mount it so the yast backup will work correct”
No, rather let a script mount it when the time comes. It can even mail you
a warning. I would use the same backup script: mount if not mounted,
backup, umount if it was not mounted. If failed, email and run again in an
hour till it succeeds. For example.
–
Cheers / Saludos,
Carlos E. R.
(from 11.2 x86_64 “Emerald” at Telcontar)
When you enetered the crontab entry of your script in the way we discussed earlier, it is in root’s crontab and you can see it with doing as root
crontab -l
You can also put entries in the system crontab* /etc/crontab* and then you can see them there.
You can also create scripts directly in the /etc/cron.daily, /etc/cron.weekly, etc directories and they will be run as Carlos explains above.
In one of the posts above I allready said that I do not know how YaST registers the backup runs, but I gave the suggestion to look in* /etc/cron.monthly*, but I do not know for sure it is there.
I would like to thank you all for your contributions!
One more question my crontab entry is
0 10 1 * * /root/backup/backup.sh
what will happen if my computer is turned of at the first of the month (eg. first day of May is a holiday).
When the system does not run the script is not run. See Carlos’ explanation about the cron.monthly etc. directories.
But do not make too much out of this. Just run the script every day at e.g. 12:00 and you will have output that is (even with holidays) only a few days old at a maximum. That is enough for things like this that do not change too much, be practical.