Kangry.com [insert cool graphic here]
home | Topics | Logout | Search | Contact | ?? Kangry ?? | Bandwitdh



New user

uploaded files
(misc)-> (Parent)->Backing up system status submited by Russell Tue 14 Apr 09
Edited Thu 16 Apr 09
Web kangry.com
so one of my lessons from the failure of the boot disk on my backup server was that I am not backing up enough data. LVM puts backups of the LVM partition data in /etc/lvm/backup but the problem is that if you lose the drive or partition that hosts /etc then your screwed. so this data should be backed up elsewhere.

I'm in the process of building an auto backup to the web. Details on that will be here when it's running.

But another problem is that the fdisk partition data isn't backup anywhere that I know of. I wrote a simple script that will collect all this data and save it in /etc/lvm/backup then I just need to backup that data else were. I wrote this script (which must be run as root)

open (OUT, ">/root/fdisk_command");
print OUT "p\nq\n";
close OUT;

open (IN," ls /dev/|cut -c1-3 |uniq |grep \"^[s,h]d\"|");
open (OUT,"> /etc/lvm/backup/fdisk_dump");
do {
chomp $line;
print OUT "#### FDISK DUMP #####\n"; 
print OUT "/dev/$line\n";
$DATA=`/sbin/fdisk /dev/$line </root/fdisk_command`;
print OUT $DATA;

} until (eof(IN));

print `/root/upload_to_kangry.pl /etc/lvm/backup/*
Since it runs as root and calls fdisk, I WOULD NOT install or run it unless you fully understand what it is doing. (view download) I have modified it by adding the last line to do automatic http post uploads of the data it creates. (required upload_to_kangry, see below)

The outout looks like this:
#### FDISK DUMP #####

Command (m for help): 
Disk /dev/sda: 1000.2 GB, 1000204886016 bytes
255 heads, 63 sectors/track, 121601 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x0008e6e3

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1          25      200781   83  Linux
/dev/sda2              26      121601   976559220   8e  Linux LVM

Command (m for help): 
#### FDISK DUMP #####

Command (m for help): 
Disk /dev/sdb: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x00000000

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1               1       60801   488384001   83  Linux

Command (m for help): 
In theory, this information could be used to re-assemble a crashed or screwed (re-partitioned) drive.
So as part of my quest to backup all my machine configurations in a sane fasion, I have created upload_to_kangry.pl
This is probably just a first version but what this does is use http post to upload files to the database on this webserver. Anybody with a kangry.com username can use this.I have provided links to list the files you have uploaded list.php and there you can either download or view the files that have been uploaded.

To install:

Download the file, edit the first 3 lines to set your kangry.com username, password and machine name. ( you can use the same login info for multiple machines) upload_to_kangry.pl will upload any file given to it as a parameter on the command line.
  • The bigest file you can upload is limited by the webserver at 2Meg. Since the uploads are urlencoded the actual limit will be smaller (probably about 1.7Meg)
  • The web server checks to see if the last file with the same name and server is the same as the one being uploaded. It will not bother to store files that are the same
  • Please don't put this in a cron job that runs more than once per day. more than that is silly. If you have a config file that changes that often, this won't solve your problem. I reserve the right to ban abusive use.
  • Contents of this server are backed up at my house, you should presume that somebody read your uploaded config files. I don't have any plans for them, but I can't really claim this is a really secure server.
  • I run upload_to_kangry.pl as root via a /etc/cron.daily, I trust it because I wrote it. You don't need to do this, You could have a root script copy the config files you want to backup (/etc/lvm/backup/* for me) to a limited user's home dir, then have the upload run as the limited user.
  • I really don't expect this to get so popular that it costs me anything to maintain this. Only of it becomes a problem, will I revisit the policy of making this service available to all comers for free.

perl upload file via wget post (upload_to_kangry.pl) (with login) (Russell)

Add comment or question...:
Submited by: NOT email address. Leave blank for anonymous    (Spam Policy)

Enter Text: (text must match image for posting)

This file (the script that presented the data, not the data itself) , last modified Wednesday 03rd of December 2014 09:40:39 AM
your client: CCBot/2.0 (http://commoncrawl.org/faq/)
current time: Sunday 30th of April 2017 06:28:17 PM