SlackwareThis Forum is for the discussion of Slackware Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Distribution: Slackware & Slamd64. What else is there?
Posts: 1,705
Rep:
Can I recover /var/log/packages after a disaster?
Hi guys,
Due to a faulty shell script I toasted my system. Lucky me, I had backed everything up 7 minutes before my runaway script. The only thing I lost was the package directory.
How can I get it updated? I can't use pkgtool to delete stuff because it doesn't think it's there. I have all the packages, too, but everything is already installed.
Distribution: Slackware & Slamd64. What else is there?
Posts: 1,705
Original Poster
Rep:
Every hour I rsync my whole system onto another drive. I set up the backup script so I can boot right into the copy of the system. I lost the main system so I just restored it from the backups. The only thing I need to do now is to restore /var/log/packages. The only thing I didn't backup was /var/log.
Well, if your system was fairly vanilla (no custom packages) and was a full install, you could copy over the /var/log/packages from another installation. If you had custom packages installed, you could still do that, but the information from those packages will be missing, so you could then do an "upgradepkg --reinstall --install-new" on the affected packages.
As a last resort, you could just do the upgradepkg --reinstall --install-new on the entire Slackware tree, and it *should* be fine, but no promises...
Good deal - glad it worked out for you.
You're going to have a few *.new files lying around now. Do a:
find / -name "*.new"
to find them (most will be in /etc), compare them to the originals, and most likely discard them. A few can be discarded immediately - /etc/passwd, shadow, group, gshadow, perhaps others - you get the idea...
Distribution: Slackware & Slamd64. What else is there?
Posts: 1,705
Original Poster
Rep:
Hi Robby,
The only packages I had to reinstall were my own and 2 stock Slackware packages that were actually there but pkgtool was showing the wrong level. It took me a few hours to clean up the mess but it seems ok, I haven't found any problems. Nothing was missing except /var/log/packages but I didn't realize what a royal PITA it is to recover it. Now I'm backing that up too
Yeah, it might seem trivial, but you definitely want to make sure it is backed up. Actually backing up all of /var is not a bad idea. That way you would have the system logs from before the failure/disaster occurred, which might be helpful.
I agree. There's no real reason not to back it up ... unless, of course, it is huge. But, that's usually not the case. For example /var is about 22 MB right now on my machine.
Distribution: Slackware & Slamd64. What else is there?
Posts: 1,705
Original Poster
Rep:
Hi guys,
I set up a mirror of my main system on another drive so I can boot into it if the primary drive fails. I didn't back up the package directory but I did back up most of /var. I'll have to think what the best way to go is now that I had my first test . Nothing like a real disaster to test your disaster recovery plans.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.