Wednesday, September 28, 2016

Computer cleanliness

Have two parts to this, the first is actual cleanliness of the hardware, and other regards data safety.

Now, it's possible to use the canned compressed air, and I have in years past (with the same PC), but now I use my air compressor mounted on the RV.  The basic steps (sorry, no pictures) are:

  1. Unplug all wires connected to PC
    1. Monitor(s)
    2. Anything USB
    3. Speakers
    4. Microphone
    5. Keyboard / mouse
    6. Power cord (of course)
  2. Remove access panels, carefully, with proper tools
    1. Be vewy vewy careful about touching any of the innards
    2. Examine for any loose connections
    3. I generally only remove one
    4. Am sure there are youtube videos for visuals
  3. Take main case outside (IMPORTANT), and close door behind you
  4. Blow all dust and stuff out of case
    1. If using canned "air", make sure no liquid comes out
      1. Hold can upright at all times
      2. Liquid coming out could be very very bad, in this case
    2. If using air compressor, no special instructions
    3. Careful around fans, nice to see spin but don't spin too much, just enough for dust removal
    4. To prevent spinning, put "nozzle" between fan blades then squirt, air of course
    5. Get into all nooks and crannies
    6. Keep at it till dust free, might be awhile
    7. Don't shake case all that much, move around gently to get best angles
  5. Take main case back inside
  6. Put case back together
    1. Pay attention for loose wires, push in/tighten as needed
    2. Put side panel back on, using proper tools
    3. Don't over tighten screws (could strip and this strip is bad)
    4. Be careful to not touch anything inappropriate
  7. Plug in all wires removed in step #1

--------------

While I await the new processor from AMD (Zen), am becoming more aware of how much wasted space I have on my storage media (hard drives mostly).  This is, in no small part, to having had to replace a couple of hard drives recently, and my days of acquiring software.

Before talking about how I backup, please note there's not one "correct" way.  Of course, am sure could always send a request to the NSA for a copy of your data, but unlikely you'll get it back due to government being government.

I typically use the free stuff and devise my own way to do it, but there are software suites which accomplish the same thing, in varying ways.  Some create an image of the drives (similar to DVD, but bigger).  Others copy files like I do.  Some have the capability to do full backups, then incremental ones over time.  Long story short, there's probably a backup package to do it in most any way.

I generally don't create an image of the whole drive, though at times it's saved my bacon and saved me days of reinstalling software.

These are some things I do, when think of it, to help make my life a little easier in times of need.

  • Save all things important that I want to a specific folder, generally C:\data or D:\data
  • Always have recovery utilities somewhat handy
    • Currently use copy of HIREN's Boot CD
    • Some contents could be from dubious origins, not overly sure
  • Run backup scripts and copy / compress to external media
    • USB Hard drive is current favorite though takes long time (USB2)
    • Using compressed files to password protect work data, and keeping same format for my PC


These steps are done on both my work computer and personal desktop computer.  All work compressed files are password protected, though the challenge is remembering said password.  Ideally should also password protect, or better, my own files, but currently don't.  I also like the thought of always taking "new" files for the backup instead of having static files on the backup that get updated/replaced/added to.  This can go either way as the backup could go bad, or the "live files" that you use every day could go bad, which results in a bad backup.  Here I feel it's a 50/50 chance.

This helps protect me from surprises and loss of data.

Up until recently I only kept one single backup, sometimes outdated by quite a few months, on one external 4 TB hard drive.  However, due to the kindness and compassion of a friend on Vashon, and his moving to using Solid State Enterprise level hard drives, I was able to obtain a bit of his older equipment for a reasonable price.  Not that the SSD's he got weren't reasonable, I mean more affordable for the average schmoe.

Now, this is my current setup, and way of doing backups, with all scripts stored in C:\batch:

  1. One Aukey metal enclosure containing two 1 TB hard drives
  2. One USB cable connects to desktop (or laptop) computer
    1. Currently only USB 2, but enclosure is USB 3
  3. Run scripts to consistently backup everything
    1. Scripts are below


The scripts I use are manually launched, using one main file that will launch subsequent processes.  What immediately follows is a description of all the files.  Of particular note, and reason for the naming, is the enclosure reports two hard drives to Windows, The first one (for me) is G, and second is H.  The scripts are named appropriately

g_FreqBackup - This does most of the grunt work and is only backup script I physically launch for the frequently updated files.  This does one backup and launches the second one through a separate process.

  1. Copy some files to a temporary location.  This is because Winblows (Windows) locks some files.  These are files that are inconvenient to always save in my Data folder.  At least on my personal computer I use the data folder more as a long term storage which won't get backup with this job.  This job is for a smaller set of files that could change frequently.
  2. Launches a secondary compression process (to the H drive).
  3. Rename existing archive file(s) so that have a history in case "accidentally" removed something.   I currently keep one extra backup file.
  4. Call a compression sub script that uses variables set in a previous section
  5. Cleanup (delete) the temporary file(s)


h_FreqBackup - The script essentially does same compression that g_FreqBackup does.  The file compression generally stays on the same filename (due to file caching) so not overly concerned about temporary files being removed early

  1. Rename existingr archive files so that have a history in case "accidentally" removed something.   I currently keep one extra backup file.
  2. Call a compression sub script that uses variables set in a previous section


rename_backup - A sub script using variables set in other scripts that will delete the existing backup backup file, if it exists, and then renames the prior backup file to save the more recent one.

compress - A sub script that simply contains the command use to compress the file (using 7Zip currently).  This gives the benefit that if want to change anything regarding the compression stuff, it's only in one spot, though have to change a few things here, for "later"...

freqfiles.txt - A simple text file containing a list of locations (directories/folders) that 7Zip will add to my archive.  This is for the ones that can frequently change.

g_backup - Main script (similar to g_FreqBackup) that will archive the less commonly used files.  It's not as fully fleshed out though will get to same level.

h_backup - Very similar to h_backup currently though will change to be more similar to h_FreqBackup as time allows

listfiles.txt - A list of directors (folders) to include in the archive

Below are the nitty gritty details of exactly what's being done.  Have included everything, except Winblows, so that there are good examples to expand  upon.

g_FreqBackup.cmd
::Script backs up frequently updated files.
::Do not really need to do the different paragraphs though it does help with readability, or if need to bypass certain things.
date /t
time /t
md c:\tempcopy
md c:\tempcopy\Desktop
xcopy C:\Users\Kutch1\Desktop c:\tempcopy\Desktop /S /V /H /J
md c:\tempcopy\Documents
xcopy C:\Users\Kutch1\Documents c:\tempcopy\Documents /S /V /H /J
md c:\tempcopy\Music
xcopy C:\Users\Kutch1\Music c:\tempcopy\Music /S /V /H /J
goto call_child

:call_child
start c:\batch\h_freqbackup.cmd
goto rename_backup

:rename_backup
set DRIVE=g:\pc\
set BKUPFILE=%DRIVE%FreqArchive_bkup.7z
set BKUPFILENAME=FreqArchive_bkup.7z
set ARCHIVEFILE=%DRIVE%%BKUPFILENAME%
call rename_backup.cmd
goto compress

:compress
call compress.cmd
goto cleanup

:cleanup
rd /S /Q c:\tempcopy
goto exitscript

:exitscript
date /t
time /t
h_FreqBackup.cmd

::Script relies on "g_" version to create temporary files
date /t
time /t
set DRIVE=h:\pc\
set BKUPFILE=%DRIVE%FreqArchive_bkup.7z
set BKUPFILENAME=FreqArchive_bkup.7z
set ARCHIVEFILE=%DRIVE%%BKUPFILENAME%
call rename_backup.cmd
goto compress

:compress
call compress.cmd
goto exitscript

:exitscript
date /t
time /t

rename_backup.cmd
if exist %BKUPFILE% del /Q %BKUPFILE%
if exist %ARCHIVEFILE% ren %ARCHIVEFILE% %BKUPFILENAME%

compress.cmd
"C:\Program Files\7-Zip\7z.exe" a -t7z -mx=2 -mmt "%BKUPFILE%" @"c:\batch\freqfiles.txt"

freqfiles.txt
C:\Program Files\7-Zip\
C:\Program Files\openscad-2015.03-2\
C:\tempcopy\Desktop\
C:\tempcopy\Documents\
C:\tempcopy\Music\
D:\Downloads\
D:\projects\
D:\Temp\
C:\batch\

g_backup.cmd
::These paragraphs aren't fully needed now though plan to expand in the future
if exist g:\pc\DataArchive.7z_bkup del /Q g:\pc\DataArchive_bkup.7z
if exist g:\pc\DataArchive.7z ren g:\pc\DataArchive.7z DataArchive_bkup.7z
goto compress

:compress
"C:\Program Files\7-Zip\7z.exe" a -t7z -mx=2 -mmt "g:\pc\DataArchive.7z" @"c:\batch\freqfiles.txt"
goto exitscript

:exitscript
date /t
time /t

h_backup.cmd
::These paragraphs aren't fully needed now though plan to expand in the future
if exist h:\pc\DataArchive.7z_bkup del /Q h:\pc\DataArchive_bkup.7z
if exist h:\pc\DataArchive.7z ren h:\pc\DataArchive.7z DataArchive_bkup.7z
goto compress

:compress
"C:\Program Files\7-Zip\7z.exe" a -t7z -mx=2 -mmt "h:\pc\DataArchive.7z" @"c:\batch\freqfiles.txt"
goto exitscript

:exitscript
date /t
time /t

listfiles.txt
C:\Program Files\7-Zip\
D:\Backup\
D:\Data\
C:\batch\

No comments:

Post a Comment