Jump to content
TNG Community

Backup Living Script


thewag

Recommended Posts

Alright, I got tired of changing things in my local software, uploading the gedcom, and then having to set the living flags....again! So I created this script that will backup and restore living flags.

Small cavets (sp?):

personID numbers can't change

gedcom names can't change

it is still in rough form.

This is still very rough, but it works!! The only item it touches is to add the living flag to people you select on restore. I doesn't change anybody elses flags. Only the ones you select. It won't remove living flags.

Hope someone else finds this usefull.

Ben

backup_living_0.8.zip

Link to comment
Share on other sites

  • Replies 116
  • Created
  • Last Reply

Top Posters In This Topic

  • thewag

    40

  • Ken Roy

    24

  • Scotty

    21

  • beckwith

    6

Top Posters In This Topic

Posted Images

Well, I found a few things to help make life easier. Return links add a little bit of JavaScript code so that you don't accidently overwrite the backup file by hitting the back button.

I downloaded your script and will test it when I am off again (Wednesday or later) and let you know how it goes. Since I always "replace all," if I have a problem it won't be a big deal, I can just re-import.

Link to comment
Share on other sites

Well, I found a few things to help make life easier. Return links add a little bit of JavaScript code so that you don't accidently overwrite the backup file by hitting the back button.

I tried your script today and it worked perfectly! This can sure save a lot of time if one has a lot of folks who are living.

You should probably include in the instructions to set permissions on the backup folder before using, then set them back when finished.

Thank You!

Link to comment
Share on other sites

I tried your script today and it worked perfectly! This can sure save a lot of time if one has a lot of folks who are living.

You should probably include in the instructions to set permissions on the backup folder before using, then set them back when finished.

Thank You!

Mm, yeah. Chmod 777 on your folder, run backup script, and chmod 775 afterwards. Can leave it at 777 if ya like, but not quiet recommended if you don't run your own server.

Link to comment
Share on other sites

Ok, added the note on file permissions to the READ file. Also made admin login required. Need to figure out how to make it point correctly to the login script.

Either way, this is important as the backupscript shows b-day on all individuals. Important upgrade for anyone that has this script on their site.

backup_living_0.8r2.zip

Link to comment
Share on other sites

Ok, added the note on file permissions to the READ file. Also made admin login required. Need to figure out how to make it point correctly to the login script.

I played around with this last night and found that the password function(s) actually go through several other script files as well.

I've attached a standalone script that will username and password protect any folder. It came from a phpBB backup script suite. I've left it intact as to who wrote it and such.

Just another avenue to try if the admin login idea is not sorted out.

The only caveat is that once applied and heaven forbid you forget the user name password you have to go through your host and delete 2 files as most FTP programs will not show them. But, other than that ;-)

Scotty

htaccess_protectthisfolder.php

Link to comment
Share on other sites

I've attached a standalone script that will username and password protect any folder. It came from a phpBB backup script suite. I've left it intact as to who wrote it and such.

Scotty, I've looked at this script...and can't get it to work. Chmod as needed and owners. For some reason the username and password don't seem to be being passed. Any suggestions?

I'm thinking that .htaccess and .htpasswd are the best way to go. That will eliminate the backupfile text from being world readable to the general public. That is a BIG security concern.

Ben

Link to comment
Share on other sites

The only caveat is that once applied and heaven forbid you forget the user name password you have to go through your host and delete 2 files as most FTP programs will not show them.

If your FTP has a command line function (I have found most do though some maybe hidden and you have to dig in the documentation to find it) use the command -la and it will show those files.

I use WS_FTP Home and it has that function, just has to dig to find how to add it. Deluxe FTP is free and has the Command function.

This Script will automatically create what you need to protect a directory. It's free and easy to use.

Good luck

Link to comment
Share on other sites

If your FTP has a command line function (I have found most do though some maybe hidden and you have to dig in the documentation to find it) use the command -la and it will show those files.

Actually, I prefer to ssh in and elinks from the source. 'ls -lha' tends to be my preference... Your suggestions are noted but won't run on my system (OS is linux).

This Script will automatically create what you need to protect a directory. It's free and easy to use.

I'll take a look at it later tonight. I did some searching last night, but between allergies, kiddies, and sleep couldn't find much.

Link to comment
Share on other sites

Scotty, I've looked at this script...and can't get it to work. Chmod as needed and owners. For some reason the username and password don't seem to be being passed. Any suggestions?

I'm thinking that .htaccess and .htpasswd are the best way to go. That will eliminate the backupfile text from being world readable to the general public. That is a BIG security concern.

Ben

Worked for me.... I believe when you set the un/pass it is already parsed. Closing the browser or clearing cookies and trying to access the folder a second time will bring up the un/pass prompt this time.

Scotty

Link to comment
Share on other sites

Worked for me.... I believe when you set the un/pass it is already parsed. Closing the browser or clearing cookies and trying to access the folder a second time will bring up the un/pass prompt this time.

Scotty

Wish it was a chache problem....but it's not writing the .htaccess and .htpasswd files. I've even passed the variables directly in the URL, with still no luck. Ah well. I'm tackling a rewrite of the script right now. Let ya know what I get in a few days.

Ben

Link to comment
Share on other sites

New version on this script is available. This script ditches the use of TNG user table and simply relies on .ht* files. Also, the pages use tng_header/footer.

I like it better now. :)

.ht* files are a major security enhancement. It reduces the chances of people viewing the backup file and getting any vitals.

PLEASE UPGRADE IF YOU ARE USING THE .8 VERSION.

Ben

backup_living_0.9.zip

Link to comment
Share on other sites

  • 3 weeks later...

New version off this script. Added a config.living.php file. Right now there is only one option. Set the $doc_root=""; for normal operation. Atleast for most. It can be changed to something like "/tng/living/" if absolute paths are needed.

I also added a little on the index page that compares the number of individuals in the DB marked living and the number in the backup file.

Enjoy.

Ben

backup_living_0.9r1.zip

Link to comment
Share on other sites

  • 1 month later...

Ben,

Thanks for providing this script. I can now use Replace All on import and then restore the Living Flags.

I have modified descend.php to add - Living on a Descendant list when you are logged in with Admin privilege, so you can easily see if you have descendants for whom you have forgotten to set the Living flag. See post http://www.tngforum.us/index.php?s=&showto...findpost&p=5227

Ken

http://www.royandboucher.com

Link to comment
Share on other sites

Ben,

Thanks for providing this script. I can now use Replace All on import and then restore the Living Flags.

I have modified descend.php to add - Living on a Descendant list when you are logged in with Admin privilege, so you can easily see if you have descendants for whom you have forgotten to set the Living flag. See post http://www.tngforum.us/index.php?s=&showto...findpost&p=5227

Ken

http://www.royandboucher.com

Glad you found a use for it! Thats what it's for. Plus, I really like your addition.

Ben

Link to comment
Share on other sites

  • 4 months later...

Glad you found a use for it! Thats what it's for. Plus, I really like your addition.

Ben

The modification for V6 to display the Living flag has moved to the descendant.php file. See TNG Forum entry

http://www.tngforum.us/index.php?s=&showto...findpost&p=6958

Ken

Link to comment
Share on other sites

I've had several questions on if the backup script works on v6. I have tested it on my box and had no problems. I could use comments, good or bad, to further "Yes, it does."

Ben

Link to comment
Share on other sites

I've had several questions on if the backup script works on v6. I have tested it on my box and had no problems. I could use comments, good or bad, to further "Yes, it does."

Ben

Ben,

I have used it to rebuild my living flags this morning after doing a gedcom import with replace all. Works like a charm as it did before. Thanks.

Ken

Link to comment
Share on other sites

  • 4 months later...

Does anyone have any experience with this script in combination with template 4?

I've just installed the backup script and it seems to work fine, but my lay-out is totally messed-up.

- None of the pictures in the title bar are visible;

- The fonts are different from what they should be;

- All the hyperlinks in the left-menu have the subdirectory of the backup script in their path, so they don't work either.

I suspect the actual problem is in topmenu.php. All the references in topmenu.php seem to be relative, and since the backup script is in its own subdirectory, topmenu.php now looks for certain files in this subdirectory as well.

Does anyone know an easy fix to this problem?

Eric

Link to comment
Share on other sites

Does anyone know an easy fix to this problem?

Sorry Eric. I include the header and footer to make the pages look nicer. Didn't know it caused problems because I don't use em! :) I'll look into it, but I can't guarantee anything soon. I'm backlogged MASSIVELY with other projects. :(

I'll put it on the to do list.

Ben

Link to comment
Share on other sites

Does anyone have any experience with this script in combination with template 4?

I suspect the actual problem is in topmenu.php. All the references in topmenu.php seem to be relative, and since the backup script is in its own subdirectory, topmenu.php now looks for certain files in this subdirectory as well.

Does anyone know an easy fix to this problem?

Eric

Hi Eric,

I use the Backup Script with Template 4, however I have updated my topmenu.php to provide the links relative to my genealogy directory. This might be mentioned in the historytemplate.php as an item that you must do.

The headers and footers work fine, if you have updated your topmenu.php to add /genealogy/ in front of the links.

Link to comment
Share on other sites

  • 9 months later...

I've had several questions on if the backup script works on v6. I have tested it on my box and had no problems. I could use comments, good or bad, to further "Yes, it does."

Ben

Ben, I have installed your scripts and it worked fine until I decided to use it a second time. Now I get this message: "To view this page, you need to log in to area “TNG Living Flag Backup/Restore Scripts” on royroyes.net:80." I cannot get my login and password to work - or maybe I am confused about which login/password to use. How can I start again?

:( Bruce Roy

Link to comment
Share on other sites

Ben, I have installed your scripts and it worked fine until I decided to use it a second time. Now I get this message: "To view this page, you need to log in to area “TNG Living Flag Backup/Restore Scripts” on royroyes.net:80." I cannot get my login and password to work - or maybe I am confused about which login/password to use. How can I start again?

:( Bruce Roy

Hey Bruce,

In the living folder you created for the backup there is a .htaccess and .htpasswd file. You can delete them to start over with a new user/password combo. BTW, this script isn't integrated into the TNG user system, so the username/password you set up here might be different than the one you use for TNG. Or it could be an old one if you change your passwords often. That part I can't help with.

G'luck.

Ben

Link to comment
Share on other sites

Hi, My first post.. New to TNG

I have everything working and added the code to show "Living" when in as administrator.. (working)

then added a "living" folder and put the living flag backup files into it... set permissions on the folder and files to "Everyone" full access (On Win2003 Server-so FTP 777 not available"

when I click on the: Backup Living Flags - This will overwrite the previous backup

I get a .... Popup.... Please click OK ... or CANCEL...

I click OK and get:

Backing Up Living Flags....

Return to Main Menu\n"); die ("Couldn't open file ($filename)"); } $Query = "SELECT gedcom, personID, lastname, firstname, birthdate FROM $people_table WHERE `living` = '1' ORDER BY `lastname` ASC , `firstname` ASC"; $Result = mysql_db_query ($database_name, $Query, $Link); if (!$Result) { echo("Error performing query: ".mysql_error()."

\n"); echo ("Return to Main Menu\n"); die(); } echo("\n"); echo(" Living Number Gedcom | Person ID Name Date of Birth

\n"); $tmpCount=1; echo("\n"); while ($tmp = mysql_fetch_array ($Result)) { echo(" $tmpCount $tmp[0] | $tmp[1] $tmp[2], $tmp[3] $tmp[4]

\n"); $tmpCount++; $tmp_fwrite="$tmp[0]|+|$tmp[1]|+|$tmp[2]|+|$tmp[3]|+|$tmp[4]\n"; if (fwrite($fp, $tmp_fwrite) === FALSE) { echo "Cannot write to file ($filename)"; echo ("Return to Main Menu\n"); die(); } } echo(" "); fclose($fp); echo ("Return to Main Menu\n"); } else { echo("There was an error connecting to the database.

\n"); echo ("Return to Main Menu\n"); die(); } tng_footer(""); ?>

I have tried everythink I can to get this to work but nothing seems to fix it..

Using Backup_living_0.9r1.zip

Thanks

Darryl

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...