Tropical Fruit Forum - International Tropical Fruit Growers



Author Topic: Anyone handy with Win/DOS scripts?  (Read 350 times)

gnappi

  • Hero Member
  • *****
  • Posts: 1559
    • South East Florida (U.S.A) Zone 10A
    • View Profile
Anyone handy with Win/DOS scripts?
« on: March 10, 2019, 01:18:35 PM »
In another thread, a well known participant of these pages lost a lot of data from a computer glitch.

I've been a computer professional all my life and I use a dos batch / script to update my 1TB external drive and thumb stick daily.

It uses less than 4 kilobytes of disk space, uses no memory resources, and needs no installation. It's completely unobtrusive to the OS and does only what the user tells it to do. It's also menu driven and impossible to mess anything up, it has a number of error checking processes that make it an easy backup scheme to use.

After an initial backup which depending on the volume of data you have AND the USB spec your machine and drives support it will take seconds to update your data daily.

I have roughly 106 gigabytes backed up that I can ill afford to lose, which is the reason I wrote it.

So, if anyone here knows how to modify a simple text file with the location of their data and the destination drive letters, I'll send it to you via Email. Since Email may have problems with a filename with a .cmd suffix, I would send it as a .txt (text) file and it can be modified and renamed by you.

I don't know how the board administrators would like it but since it's only text I could copy it in a post here also.



 
Regards,

   Gary

fyliu

  • Hero Member
  • *****
  • Posts: 3172
    • Burbank/Covina, CA 10a
    • View Profile
Re: Anyone handy with Win/DOS scripts?
« Reply #1 on: March 12, 2019, 03:14:53 PM »
Backing up is a good idea. Maybe you can post a link to it?

I used to have an rsync script that did daily, weekly, monthly backups. Even though there are dated backup folders that look like they contain full copies of all the files, the files are not duplicated in the disk if they weren't changed across time. I'm not very good with windows so I don't know if there's anything similar that can be done.

Cookie Monster

  • Broward, FL Zone 10b
  • Administrator
  • Hero Member
  • *****
  • Posts: 4421
  • Eye like mangoes
    • Tamarac, FL, 33321, 10B
    • View Profile
Re: Anyone handy with Win/DOS scripts?
« Reply #2 on: March 12, 2019, 05:57:37 PM »
There are also a lot of online backup solutions out there, which ensures you still have your files in the event of a fire or burglary. Mozy (now carbonite I guess) is $6/month.
Jeff  :-)

starch

  • Hero Member
  • *****
  • Posts: 767
  • My brain is like oatmeal
    • Chandler, AZ. zone 9b
    • View Profile
Re: Anyone handy with Win/DOS scripts?
« Reply #3 on: March 12, 2019, 07:23:53 PM »
I do something similar. I am a UNIX weenie but I have some machines that I have to run Windows on.  To back up those machines to other machines and/or external hard disks, I install cygwin and use rsync to back stuff up. I have been using rsync for (many) years and it is very easy to script / and search patterns and wildcards to choose what and what not to back up. It also backs stuff up based on reading the source and destination directories and only backs up files that have changed to make the backups very efficient.
- Mark

gnappi

  • Hero Member
  • *****
  • Posts: 1559
    • South East Florida (U.S.A) Zone 10A
    • View Profile
Re: Anyone handy with Win/DOS scripts?
« Reply #4 on: March 13, 2019, 10:12:27 AM »
I don't have it online, it's just a text file (albeit a more than complicated one to make from scratch) that only runs on demand, and after the initial copy it only copies new data. It's only 53kb (allocation unit depends on O/S) even with the liberal comments.

I absolutely will not use any sort of cloud backup, if it's not local, it's not 100% safe, or 100% available 100% of the time.

Here's a screenshot after a completed copy / backup.

https://ibb.co/Rhj4R9d
« Last Edit: March 13, 2019, 10:29:02 AM by gnappi »
Regards,

   Gary

gnappi

  • Hero Member
  • *****
  • Posts: 1559
    • South East Florida (U.S.A) Zone 10A
    • View Profile
Re: Anyone handy with Win/DOS scripts?
« Reply #5 on: March 13, 2019, 10:26:08 AM »
Backing up is a good idea. Maybe you can post a link to it?

I used to have an rsync script that did daily, weekly, monthly backups. Even though there are dated backup folders that look like they contain full copies of all the files, the files are not duplicated in the disk if they weren't changed across time. I'm not very good with windows so I don't know if there's anything similar that can be done.

Actually the DOS/Win scripting "language" is fairly rich. At my last job I used it to backup dozens of mission critical machines that could not and would not EVER be connected to any other machine outside of its closed network. Real time restore from a native file that's not compressed and is local saved my bacon more than a few times. Add to that the native DOS command prompt usage does not rely on second or third party software, or ANSI hacks.

Maybe DOS scripting is not as rich as Linux/Unix (which I've created to build a kernel) but DOS is more than powerful enough to make copies only of data that has changed since the last execution.



« Last Edit: March 13, 2019, 10:53:49 AM by gnappi »
Regards,

   Gary

Cookie Monster

  • Broward, FL Zone 10b
  • Administrator
  • Hero Member
  • *****
  • Posts: 4421
  • Eye like mangoes
    • Tamarac, FL, 33321, 10B
    • View Profile
Re: Anyone handy with Win/DOS scripts?
« Reply #6 on: March 13, 2019, 02:54:13 PM »
Nothing is 100% safe and available. Those two concepts are sort of mutually exclusive.

Availability and reliability of mozy online backup has been great. We even use it as part of our multi-tiered backup routine at work (for the source code repo). Nice thing is that backups are literally available from any computer with a network connection. If privacy is an issue, there is generally support for encryption. A good cloud backup provider will offer geo-redundancy as well as high security (2 factor auth, encryption, etc).

For a reasonably secure home backup solution, one would want to keep the backups in a TL-15 or better fire safe. Generally that's a pain to do on a daily basis.

From my experience, though, the least reliable part of the backup process is ensuring that the backup job has run. Even with high-end Quantum backup software at work, I can't count the number of times we didn't realize the backup process failed to run until several days / weeks later. We now have a 4-tier process with geo-redundancy, where a boat load of things would need to go wrong before we'd lose a backup.

I absolutely will not use any sort of cloud backup, if it's not local, it's not 100% safe, or 100% available 100% of the time.
Jeff  :-)

fyliu

  • Hero Member
  • *****
  • Posts: 3172
    • Burbank/Covina, CA 10a
    • View Profile
Re: Anyone handy with Win/DOS scripts?
« Reply #7 on: March 13, 2019, 04:26:25 PM »
Right, I do local backups too but I realize that something like a fire will wipe out everything. Better to also have off-site copies once in a while.

Thanks gnappi. I hope someone takes you up on your offer. It looks like you put a good amount of thought into it. I run mainly linux so it doesn't work for me.

gnappi

  • Hero Member
  • *****
  • Posts: 1559
    • South East Florida (U.S.A) Zone 10A
    • View Profile
Re: Anyone handy with Win/DOS scripts?
« Reply #8 on: March 14, 2019, 06:54:18 AM »
Right, I do local backups too but I realize that something like a fire will wipe out everything. Better to also have off-site copies once in a while.

Thanks gnappi. I hope someone takes you up on your offer. It looks like you put a good amount of thought into it. I run mainly linux so it doesn't work for me.

I keep my 128GB memory stick on my key chain, can't get much more fireproof than that, well unless I spontaneously go buddhist monk :-) Then I guess backups will be useless.

It's as bulletproof as I can make it, and yes, many use the script.
Regards,

   Gary

gnappi

  • Hero Member
  • *****
  • Posts: 1559
    • South East Florida (U.S.A) Zone 10A
    • View Profile
Re: Anyone handy with Win/DOS scripts?
« Reply #9 on: March 14, 2019, 09:29:32 AM »
Nothing is 100% safe and available. Those two concepts are sort of mutually exclusive.
>>SNIP<<

Actually, I couldn't disagree more unless you refer to the span of time between backups. Having a plan with multiple proven archival copies/ backups is bullet proof. The only thing missing is the tenacity of the user to be diligent in their processes... at regular intervals.

I've had enough business and personal disasters to make drive clones, and archival copies routine. IMO, the fact is that multiple drives electrically disconnected to everything and anything that are regularly updated have an infinitesimally small risk. My method is no different than having a RAID1 (where I spent working 7 years in R&D and 15 at IBM) array with the destination drives disconnected.

I haven't lost data on hundreds of machines over some 20+ years despite dozens and dozens of drive crashes. All without cloud, or relying on (shudder) tapes. YMMV.

 
Regards,

   Gary

Cookie Monster

  • Broward, FL Zone 10b
  • Administrator
  • Hero Member
  • *****
  • Posts: 4421
  • Eye like mangoes
    • Tamarac, FL, 33321, 10B
    • View Profile
Re: Anyone handy with Win/DOS scripts?
« Reply #10 on: March 14, 2019, 11:00:44 AM »
Safe and available have an inverse relationship. The safer an item is, the less available it is. Data that is disconnected is, by definition, not available. And I don't know of anything in the computing world that is 100% anything. Typically we speak in terms of number of 9's (eg, five-nines of reliability).

Getting back to fruit trees (;-), we increase the safety of our valued cultivars by increasing their availability (distributing budwood). An anecdote: I was told that one of Gary Zill's selections (Lemon zest?) was almost lost forever, had it not been for a second tree planted on Water Zill's property :D.

We use a 4-tier backup solution at my work: local, cloud, tape, hard copies in physical safes at multiple locations. A little over the top for personal photo backups though. Cloud is a good compromise for that.

Nothing is 100% safe and available. Those two concepts are sort of mutually exclusive.
>>SNIP<<

Actually, I couldn't disagree more unless you refer to the span of time between backups. Having a plan with multiple proven archival copies/ backups is bullet proof. The only thing missing is the tenacity of the user to be diligent in their processes... at regular intervals.

I've had enough business and personal disasters to make drive clones, and archival copies routine. IMO, the fact is that multiple drives electrically disconnected to everything and anything that are regularly updated have an infinitesimally small risk. My method is no different than having a RAID1 (where I spent working 7 years in R&D and 15 at IBM) array with the destination drives disconnected.

I haven't lost data on hundreds of machines over some 20+ years despite dozens and dozens of drive crashes. All without cloud, or relying on (shudder) tapes. YMMV.
Jeff  :-)

gnappi

  • Hero Member
  • *****
  • Posts: 1559
    • South East Florida (U.S.A) Zone 10A
    • View Profile
Re: Anyone handy with Win/DOS scripts?
« Reply #11 on: March 14, 2019, 11:04:37 AM »
Water Zills? Is / was that a location on U.S 1 in Boynton?
Regards,

   Gary

Cookie Monster

  • Broward, FL Zone 10b
  • Administrator
  • Hero Member
  • *****
  • Posts: 4421
  • Eye like mangoes
    • Tamarac, FL, 33321, 10B
    • View Profile
Re: Anyone handy with Win/DOS scripts?
« Reply #12 on: March 14, 2019, 02:37:42 PM »
Yes, that's the place.

Water Zills? Is / was that a location on U.S 1 in Boynton?
Jeff  :-)

 

Copyright © Tropical Fruit Forum - International Tropical Fruit Growers