One Step Cleanup-Backup

A section for all development and testing programmes and customised browsers written by SillyDog701 community. Featured products including Donzilla, Firescape, DJGM Distro, and Netscape Streamline.

Moderator: Don_HH2K

One Step Cleanup-Backup

Postby Ramona » Thu 13 Mar, 2003 1:11 am

Hi Fellow Testers,

Captjlddavis has created the below posted batch file. This file will delete the Cache Folder, history.dat and XUL.mfl files, and then will back up the salted folder. We have been collaberating on this project for the last couple of days. We both were using a batch file for the cleanup, and Captjlddavis was innovative enough to add to the batch file, the backup of the salted folder.

I've been testing the files for him as he has done the refining. Certainly no problems with using the batch file, not to mention the convenience... That was my collaberation, and he did the development!

Would any of you be interested in testing, or using the batch file, and giving some feedback? If so, then paste the below data into Notepad, and save the file as nsbak.bat. You must also create a destination folder for the backup that will be created.

If you have more questions, let me know, and perhaps Antony would be kind enough to let Captjlddavid have access to this Forum, in order to answer any questions you might have. I would very much like to add this file to my Solutions page, but Captjlddavis felt that more user testing was in order first.

Thanks,

Ramona


Code: Select all
::nsbak.bat

::*********************************************************************************
::* For this batch file to function properly, ALL Netscape files MUST be closed.  *
::* Including AIM and Quick Launch.                                               *                                             
::* To use for different Profiles - EDIT the"set profilename=<profile name>" and  *
::* "set salted =<salted>.slt" lines below. To change Destination - Edit the      *
::* "set where=<destination>" line It appears that the distination Folder has to  *
::* be ONLY one word- something to do with the xcopy command  - You can use       *
::* some punctuation "-" , "_",but NOT "/"                                        *
::*                                                                               *
::*********************************************************************************
set profilename=jim
set salted=xqwzlbyn.slt
set where=e:\jims-ns_bak'up
deltree /y c:\windows\applic~1\mozilla\profiles\%profilename%\%salted%\cache
deltree /y c:\windows\applic~1\mozilla\profiles\%profilename%\%salted%\history.dat
deltree /y c:\windows\applic~1\mozilla\profiles\%profilename%\%salted%\xul.mfl
:: deletes cache, history and xul.mfl before copying
xcopy "c:\windows\applic~1\mozilla\profiles\%profilename%\%salted%\" %where% \%profilename%\ /s /q /h /e
::/h switch Includes files with hidden and system attributes set.
::This switch does function in Dos mode when using the WindowsME version of XCOPY.
::/e switch copies empty folders
::/q switch supresses copying info on screen
UserAgent: Mozilla/5.0 (Windows; U; Win98; en-US; rv:1.0.2) Gecko/20030208 Netscape/7.02 (CK-profman)
User avatar
Ramona
Moderator
Moderator
 
Posts: 2376
Joined: Wed 19 Jun, 2002 3:50 pm
Location: Midwest USA

Postby profman » Thu 13 Mar, 2003 3:43 pm

I'll give it a try, although I may change it not to delete the history which I like to keep (for 90 days!). Looks like a good idea!

I've been doing some batch work lately to back up my system files in Windows 98 by adapting a batch file from the LangaList. It saves the files to a ZIP disk and replaces the discontinued ZIP Rescue.
UserAgent: Mozilla/5.0 (Windows; U; Win98; en-US; rv:1.3b) Gecko/20030221
profman, the mad chemist
Moderator of SillyDog Forums
User of Thunderbird 2.0.0.x & Firefox 3.x
Try Forum Search
User avatar
profman
Moderator
Moderator
 
Posts: 1528
Joined: Wed 11 Sep, 2002 8:00 pm

Postby Ramona » Thu 13 Mar, 2003 4:02 pm

Hi profman,

Thanks so much!!! I appreciate so much your giving it a trial. BTW, I'm curious as to how you branded your Browser. How do you do that? Somewhere in my copious notes, I have instructions on how to do that in IE, but not Netscape.

Do you have a link for the Langa batch file? I have an internal Zip Drive which I could use for those backups. I do a backup of system files about once/month on CD, but do my daily backups on Zip.

Cheers!

Ramona :mrgreen:
UserAgent: Mozilla/5.0 (Windows; U; Win98; en-US; rv:1.0.2) Gecko/20030208 Netscape/7.02 (CK-profman)
User avatar
Ramona
Moderator
Moderator
 
Posts: 2376
Joined: Wed 19 Jun, 2002 3:50 pm
Location: Midwest USA

Postby captjlddavis » Fri 14 Mar, 2003 2:19 am

Hello to all,

Antony has added me to the group. I appreciate any comment or suggestions
regards this little batch file. I can't see anything wrong with it, but am sure that others have comments.

Thanks in advance.

regards:
captjlddavis
UserAgent: Mozilla/5.0 (Windows; U; Win98; en-US; rv:1.0.2) Gecko/20030208 Netscape/7.02 (Compact)
old age and treachery will overcome youth and skill everytime......
User avatar
captjlddavis
gold member
gold member
 
Posts: 540
Joined: Tue 10 Sep, 2002 7:42 pm
Location: US Westcoast

Postby captjlddavis » Sat 15 Mar, 2003 10:56 pm

WARNING

While this batch file will do what it is supposed to do, it will corrupt the profile that is open if run without closeing NS first.

I sincerly hope that I have not caused any of you undue stress. I thank any and all of you that have showed an interest.

I guess it's back to the drawing board.

regards:captjlddavis
UserAgent: Mozilla/5.0 (Windows; U; Win98; en-US; rv:1.0.2) Gecko/20030208 Netscape/7.02 (Compact)
old age and treachery will overcome youth and skill everytime......
User avatar
captjlddavis
gold member
gold member
 
Posts: 540
Joined: Tue 10 Sep, 2002 7:42 pm
Location: US Westcoast

Postby profman » Mon 17 Mar, 2003 1:50 pm

I just used the CCK to "brand" my browser. I entered "profman branded" (no quotes) into the field for Custom Title Bar Text. I also entered "profman" into the fields of Company Indentifier and "Netscape 7 by".

Is it still OK to test "nsbak.bat as long as Netscape is NOT running?
UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.0.2) Gecko/20021120 Netscape/7.01 (CK-profman)
profman, the mad chemist
Moderator of SillyDog Forums
User of Thunderbird 2.0.0.x & Firefox 3.x
Try Forum Search
User avatar
profman
Moderator
Moderator
 
Posts: 1528
Joined: Wed 11 Sep, 2002 8:00 pm

Postby captjlddavis » Mon 17 Mar, 2003 4:55 pm

profman,

Yes, you can safely test the batch file with NS colsed. If you do test with NS open and it corrupt the test profile, just close NS and run the batch file again.

Ramona and I have done this and it seems to work.

I sent you an email with more info. I have a little more tweaking to do before I go public and appreciate any feed back.

Thanks again.

regards:captjlddavis
UserAgent: Mozilla/5.0 (Windows; U; Win98; en-US; rv:1.0.2) Gecko/20030208 Netscape/7.02 (Compact)
old age and treachery will overcome youth and skill everytime......
User avatar
captjlddavis
gold member
gold member
 
Posts: 540
Joined: Tue 10 Sep, 2002 7:42 pm
Location: US Westcoast

Batch Files Replacement for ZIP Rescue

Postby profman » Mon 17 Mar, 2003 5:00 pm

The batch files referenced below backup up and restore USER.DAT, SYSTEM.DAT, WIN.INI, SYSTEM.INI, PROTOCOL.INI, AUTOEXEC.BAT, and CONFIG.SYS. I edited copies of them for use on some of my systems to backup and restore from a ZIP drive. These batch files now replace, for me, the Norton Zip Rescue which Norton discontinued "because customers have expressed a preference for alternative media and methods of backup."

The batch files are discussed in the LangaList at the links below:

http://www.langa.com/newsletters/1999/n ... htm#backup
http://www.langa.com/newsletters/2001/2001-03-01.htm#3

The backup batch files can function under Windows, but the restore batch files function under full DOS (clean boot or Safe Mode Command Prompt). I extensively modified these batch files. I changed the backup file so that it would backup my files to a directory on the ZIP 250 drive which is drive "G" under Windows on my system. The drive letter for the ZIP drive changes to "B" under DOS, so I had to create a new edited backup file which would function under DOS. The backup file alters and restores the "rh" attributes of registry.dat and user.dat, so you have to be quite careful when writing or testing this backup batch file. I also added a couple of other files to the list that the batch file backs up. Running the "B" version of the back up batch file under Windows caused problems for me, including a BSOD.

The restore file only should be run under full DOS. I created several different batch files so that I would have the choice of which files that I wanted to restore. Once these batch file are created, it becomes relatively easier to adapt them to other systems by just changing the letter for the ZIP drive.

One last caution, if you try to rename any batch file under windows, you may accidentally double click on it and "run" the file. These files have a simple PAUSE command built into them along with a warning to halt further execution if desired. Its slim protection for anyone who does not look at the screen at the right moment.
UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.0.2) Gecko/20021120 Netscape/7.01 (CK-profman)
profman, the mad chemist
Moderator of SillyDog Forums
User of Thunderbird 2.0.0.x & Firefox 3.x
Try Forum Search
User avatar
profman
Moderator
Moderator
 
Posts: 1528
Joined: Wed 11 Sep, 2002 8:00 pm

Postby profman » Sat 22 Mar, 2003 3:33 pm

I've test the improved batch files, that captjlddavis sent me, under Windows 98. The first problem was an "out of environmental space message" since I have nothing set for MS DOS programs in CONFIG.SYS. I solved this by creating a shortcut in which I set environmental space to a generous 1024.

The second problem was the refusal of the program to run on my profile by the name of PMILLERDJ'S ACCOUNT. I tried, unsuccessfully, several times using quotation marks at various places. I solved this by using the folder's MS DOS name of PMILLE~1. This created the proper backup in the proper location under the folder PMILLE~1. If I failed to give it enough environmental space, the PMILLE~1 folder would be created on the C drive instead.

I don't think I caused any damage, although some of my experimentation with XCOPY seemed to copy files to locations that I have yet to find. Oh well. I also was just a bit surprised to find out that it deletes the CACHE folder itself, not just the files in it. Netscape just regenerates the CACHE folder with no problems. (So I learned something new!)

I plan on using the batch file to back up my various profiles.

Thanks to both captjlddavis and Ramona!
UserAgent: Mozilla/5.0 (Windows; U; Win98; en-US; rv:1.0.2) Gecko/20021120 Netscape/7.01 (CK-profman)
profman, the mad chemist
Moderator of SillyDog Forums
User of Thunderbird 2.0.0.x & Firefox 3.x
Try Forum Search
User avatar
profman
Moderator
Moderator
 
Posts: 1528
Joined: Wed 11 Sep, 2002 8:00 pm

Postby captjlddavis » Sat 22 Mar, 2003 4:53 pm

profman,

Thank you for taking the time to test these for me.

regards setting enviormental space:

win98se, I don't have this set anywhere that I can find, config.sys holds nothing.

I believe that not supporting long file names has to be something with the xcopy command structure. Will have to research that some more.

Did you use the "define.bat" to set the various profile information ? And did you find it of any value ?

Regards the deleting of the "cache" folder:

As you found, NS will rebuid it if it is not here. If this makes you nervious, you can add "*.*" to the delete string and it will leave the folder but delete everything in it.
(deltree /y c:\windows\applic~1\mozilla\profiles\%profilename%\%salted%\cache\*.*

Again thanks for the feedback. I will do a little more tweaking before going public.

regards:captjlddavis
UserAgent: Mozilla/5.0 (Windows; U; Win98; en-US; rv:1.0.2) Gecko/20030208 Netscape/7.02 (Compact)
old age and treachery will overcome youth and skill everytime......
User avatar
captjlddavis
gold member
gold member
 
Posts: 540
Joined: Tue 10 Sep, 2002 7:42 pm
Location: US Westcoast

Postby profman » Sun 23 Mar, 2003 1:23 pm

Yes, I thought "define.bat" was a clever idea, and I did use that file. I made and named another bat file file to define the parameters for each profile that I wanted to work on.

I was able to copy some of the text resulting from one of my first runs of the batch files. This text was as follows:
C:\Bat>set where=e:\nsbackup\
Out of environment space

C:\Bat>
C:\Bat>call nsbak.bat

C:\Bat>
C:\Bat>
C:\Bat>deltree /y c:\windows\applic~1\mozilla\profiles\"Pmillerdj's Account"\3g
xilhyf.slt\\cache
Deleting c:\windows\applic~1\mozilla\profiles\Pmillerdj's Account\3gxilhyf.slt\
\Cache...

C:\Bat>
C:\Bat>xcopy "c:\WINDOWS\Application Data\Mozilla\Profiles\"Pmillerdj's Account
"\3gxilhyf.slt\\" \"Pmillerdj's Account"\3gxilhyf.slt\\ /s /q /h /e
Invalid number of parameters
0 File(s) copied

C:\Bat>
C:\Bat>
C:\Bat>
I may not have able to captured some of the earlier text that was forced up in the DOS windows. Making the changes that I had mentioned solved these problems. I do not know how Windows handles environmental space. I just figured out how to increase it to avoid the one error.
UserAgent: Mozilla/5.0 (Windows; U; Win98; en-US; rv:1.3b) Gecko/20030221
profman, the mad chemist
Moderator of SillyDog Forums
User of Thunderbird 2.0.0.x & Firefox 3.x
Try Forum Search
User avatar
profman
Moderator
Moderator
 
Posts: 1528
Joined: Wed 11 Sep, 2002 8:00 pm


Return to SD701 DevZone

Who is online

Registered users: Google [Bot]