Monday, September 9, 2013

WINDOWS - CYGWIN - Backup with RSYNC one drive to another, clone drive contents with rsync

Note this is not really a clone, clones work more with images in my opinion. They work directly on the block level instead of the file level.

I give you this which my own personal backup strategy for my external drives. I dont mind if you know this, I changed some of the words in my directories. Big woop.

One thing I dont cover is how I setup my scheduled tasks with Windows Task Scheduler, because I hate describing click by click you can google your way to how to set it up. I just used the default options that made sense and I run this script a couple times a week on Tuesday and Sunday.

4 Sections here:
1. This intro so this is the end of section 1
2. How to setup the main backup scripts, the actual meat of the backup job
3. OPTIONAL watch progress
4. OPTIONAL setup a progress script for the very first job (considering that the target was first empty, either way measures speed good)
 .....
 
Original text is HERE

How do I use Robocopy to copy ACLs without copying data?

ROBOCOPY can be used to copy the ACLs of existing files, without copying the files, but the documentation is NOT obvious on how to accomplish this.

To copy the security information for files that exits at both the source and destination, and to NOT copy the files, use:

robocopy [Source] [Destination] /secfix /xo /xn /xc

To mirror a [Source] folder on a [Destination] folder:

robocopy [Source] [Destination] /secfix /xo /xn /xc \[Other parameters\]
robocopy [Source] [Destination] /secfix \[Other parameters\]

Backup and Restore NTFS permissions with icacls

Icacls is a simple command line utility to backup and restore or apply new NTFS permissions. I use this tool mostly to back-up NTFS permissions before I make major changes on the current NTFS ACLs. This command line utility is available on Server 2003 SP2 or higher, also available on server 2008 & Windows 7.
To get help or get examples just type icacls in command prompt.
Example: Backup NTFS permissions
icacls “D:\HomeTest” /save “c:\Temp\ntfsbackup.txt” /t /c

In this example we backup all permissions of “D:\HomeTest” and save them in “c:\Temp”. The /T switch allows it to get also the permissions of sub folders, the /C switch allows it to continue even if errors occurs.
Example: Restore NTFS permissions
icacls d:/ /restore c:\Temp\ntfsbackup.txt

It is not necessary to mention the destination folder because this is already included in the backup file which very important to know. It’s sufficient to specify the destination drive.
From my experience it’s possible to back-up a complete drive like “e:/” but you can’t restore without specifying a drive letter, so my advice is always specify a folder instead of a complete drive.
More info: Technet

Thursday, July 25, 2013

How To Backup ESXi Configuration

Backing up your ESXi Configuration:

 To backup your ESXi configuration you’ll be using the vicfg-cfgbackup.pl command as follows:
  • Download either the vMA or vCLI
  • Launch vicfg-cfgbackup.pl:

    C:\Program Files\VMware\VMware vSphere CLI\bin>vicfg-cfgbackup.pl --server -s name_of_the_server.bak

  • Note: The backup will be stored at path:
    C:\Program Files (x86)\VMware\VMware vSphere CLI

Restoring your ESXi Configuration:

Restoring your ESXi config can be done after you have the host up and responding over the network again by using the following:

C:\Program Files\VMware\VMware vSphere CLI\bin>vicfg-cfgbackup.pl --server -l name_of_the_server.bak

Note: You will be asked to reboot the host on restore.
Backing  up multiple hosts! – There is a script to backup multiple ESXi hosts on the VMware communities site here. Also in PowerCLI here!

Friday, July 19, 2013

cfg2html on Solaris - OS configuration Backup

cfg2html is very use full script to take all the system configuration backup in text format and html format.This script is available for Solaris,various Linux flavors and HP-Unix.
For more information about the script,please visit
http://groups.yahoo.com/group/cfg2html.

Once you run the script by default it will generate three files.
1. System configuration in text format
2. System configuration in html format
3. Script Error log

These configuration backup files are very useful to build the server from scratch.But we have to  make sure you have latest configuration backup by running cfg2hmtl periodically and keep the output in other location or web portal for future reference.

Here is the script which you can download it and use it for Solaris 10.
Download cfg2html  Click on File tab- > Select Download


Download the cfg2html and keep in /var/tmp/

#cd /var/tmp
#tar -xvf cfg2html_solaris10_v1.0.tar
#cd cfg2html_solaris_10v1.0
bash-3.00# ls -lrt
total 56
-rwx------1 root root 24796 Jul 18 14:46 cfg2html_solaris_10v1.0
drwx------2 root root 11 Jul 18 14:46 plugins

bash-3.00# ./cfg2html_solaris_10v1.0
-------------------------------------------------
Starting          cfg2html_solaris_10 version 1.0 on a SunOS 5.10 i86pc
Path to cfg2html  ./cfg2html_solaris_10v1.0
Path to plugins   ./plugins
HTML Output File  /Desktop/cfg2html_solaris10_v1.0/cfg2html_solaris10_v1.0/sfos_cfg.html
Text Output File  /Desktop/cfg2html_solaris10_v1.0/cfg2html_solaris10_v1.0/sfos_cfg.txt
Errors logged to  /Desktop/cfg2html_solaris10_v1.0/cfg2html_solaris10_v1.0/sfos_cfg.err
Started at        2012-07-18 14:46:51
-------------------------------------------------
-------------------------------------------------
Collecting:  System Hardware and Operating System Summary  ..
Collecting:  Disk Device Listing  ....
Collecting:  Host-Bus Adapters (HBAs)  ...
Collecting:  Solaris Volume Manager (SVM)  ......
Collecting:  Local File Systems and Swap  ......
Collecting:  NFS Configuration  .....
Collecting:  Zone/Container Information  ......
Collecting:  Network Settings  ..........
Collecting:  EEPROM  ....
Collecting:  Cron  ...
Collecting:  System Log  ..
Collecting:  Resource Limits  .....
Collecting:  Services  ....
Collecting:  VxVM  ...........
Collecting:  VxFS  ..
-------------------------------------------------

bash-3.00# ls -lrt
total 337
-rwx------1 root root  24796 Jul 18 14:46 cfg2html_solaris_10v1.0
drwx------2 root root          11 Jul 18 14:46 plugins
-rw-r--r--   1 root     root   732 Jul 18 14:47 sfos_cfg.err
-rw-r--r--   1 root     root   77295 Jul 18 14:47 sfos_cfg.html
-rw-r--r--   1 root     root   65492 Jul 18 14:47 sfos_cfg.txt
bash-3.00# uname -a
SunOS sfos 5.10 Generic_142910-17 i86pc i386 i86pc

You can copy to windows and upload it in desired location .

you can add the cfg2hmtl  in cronjob to run cfg2html periodically .

# export EDITOR=vi
# corntab -e
Add the below lines in the end of the file.
00 23 15 * * /var/tmp/cfg2html_solaris10_v1.0/cfg2html_solaris_10v1.0  > /dev/null 2> /dev/null
00 23 01 * * /var/tmp/cfg2html_solaris10_v1.0/cfg2html_solaris_10v1.0  > /dev/null 2> /dev/null

save the file & exit.The above job will run cfg2html 1st and 15th of the month at 11PM .

cfg2html on Solaris - OS configuration Backup

at 15:22

cfg2html is very use full script to take all the system configuration backup in text format and html format.This script is available for Solaris,various Linux flavors and HP-Unix.
For more information about the script,please visit 
http://groups.yahoo.com/group/cfg2html.

Once you run the script by default it will generate three files. 
1. System configuration in text format  
2. System configuration in html format
3. Script Error log

These configuration backup files are very useful to build the server from scratch.But we have to  make sure you have latest configuration backup by running cfg2hmtl periodically and keep the output in other location or web portal for future reference.


Here is the script which you can download it and use it for Solaris 10.

Download cfg2html  Click on File tab- > Select Download 


Download the cfg2html and keep in /var/tmp/
#cd /var/tmp
#tar -xvf cfg2html_solaris10_v1.0.tar
#cd cfg2html_solaris_10v1.0
bash-3.00# ls -lrt
total 56
-rwx------1 root root 24796 Jul 18 14:46 cfg2html_solaris_10v1.0
drwx------2 root root 11 Jul 18 14:46 plugins

bash-3.00# ./cfg2html_solaris_10v1.0
-------------------------------------------------
Starting          cfg2html_solaris_10 version 1.0 on a SunOS 5.10 i86pc
Path to cfg2html  ./cfg2html_solaris_10v1.0
Path to plugins   ./plugins
HTML Output File  /Desktop/cfg2html_solaris10_v1.0/cfg2html_solaris10_v1.0/sfos_cfg.html
Text Output File  /Desktop/cfg2html_solaris10_v1.0/cfg2html_solaris10_v1.0/sfos_cfg.txt
Errors logged to  /Desktop/cfg2html_solaris10_v1.0/cfg2html_solaris10_v1.0/sfos_cfg.err
Started at        2012-07-18 14:46:51
-------------------------------------------------
-------------------------------------------------
Collecting:  System Hardware and Operating System Summary  ..
Collecting:  Disk Device Listing  ....
Collecting:  Host-Bus Adapters (HBAs)  ...
Collecting:  Solaris Volume Manager (SVM)  ......
Collecting:  Local File Systems and Swap  ......
Collecting:  NFS Configuration  .....
Collecting:  Zone/Container Information  ......
Collecting:  Network Settings  ..........
Collecting:  EEPROM  ....
Collecting:  Cron  ...
Collecting:  System Log  ..
Collecting:  Resource Limits  .....
Collecting:  Services  ....
Collecting:  VxVM  ...........
Collecting:  VxFS  ..
-------------------------------------------------

bash-3.00# ls -lrt
total 337
-rwx------1 root root  24796 Jul 18 14:46 cfg2html_solaris_10v1.0
drwx------2 root root          11 Jul 18 14:46 plugins
-rw-r--r--   1 root     root   732 Jul 18 14:47 sfos_cfg.err
-rw-r--r--   1 root     root   77295 Jul 18 14:47 sfos_cfg.html
-rw-r--r--   1 root     root   65492 Jul 18 14:47 sfos_cfg.txt
bash-3.00# uname -a
SunOS sfos 5.10 Generic_142910-17 i86pc i386 i86pc
You can copy to windows and upload it in desired location .

you can add the cfg2hmtl  in cronjob to run cfg2html periodically .
# export EDITOR=vi
# corntab -e
Add the below lines in the end of the file.
00 23 15 * * /var/tmp/cfg2html_solaris10_v1.0/cfg2html_solaris_10v1.0  > /dev/null 2> /dev/null
00 23 01 * * /var/tmp/cfg2html_solaris10_v1.0/cfg2html_solaris_10v1.0  > /dev/null 2> /dev/null
save the file & exit.The above job will run cfg2html 1st and 15th of the month at 11PM .
- See more at: http://www.unixarena.com/2012/07/cfg2html-on-solaris-os-configuration.html#sthash.jbCYLK2o.dpuf

Tuesday, July 9, 2013

HOW-TO get MP IP address from HP-UX

I found out that now there is a posibility to get the IP of the MP/GSP from the HP-UX servers, just in case you forgot or can't phisicaly access the server:

You need to have installed the sfm product:

SFM-CORE B.05.00.05 HPUX System Fault Management

It commes standard with the 11.23 FOE, so probably you have it by default.

Then you just lauch:

 #/opt/sfm/bin/CIMUtil -e root/cimv2 HP_ManagementProcessor  
 Instance 0 :  
 UniqueIdentifier : 0.19.33.124.117.193  
 ControllerType : 3  
 OtherControllerType :  
 IPAddress : 10.10.11.250 <------ MP IP  
 URL : http://10.10.11.250 <------ MP IP  
 Dedicated : 14  
 CreationClassName : HP_ManagementProcessor  
 Name : Management Processor  
 EnabledState : 2  
 OperationalStatus : 2  

I found out that now there is a posibility to get the IP of the MP/GSP from the HP-UX servers, just in case you forgot or can't phisicaly access the server:
You need to have installed the sfm product:
SFM-CORE B.05.00.05 HPUX System Fault Management
It commes standard with the 11.23 FOE, so probably you have it by default.
Then you just lauch:
#/opt/sfm/bin/CIMUtil -e root/cimv2 HP_ManagementProcessor
Instance 0 :
UniqueIdentifier : 0.19.33.124.117.193
ControllerType : 3
OtherControllerType :
IPAddress : 10.10.11.250 <------ br="" ip="" mp=""> URL : http://10.10.11.250 <------ br="" ip="" mp=""> Dedicated : 14
CreationClassName : HP_ManagementProcessor
Name : Management Processor
EnabledState : 2
OperationalStatus : 2
- See more at: http://www.hpuxtips.es/?q=node/175#sthash.r8RDvWar.dpuf
I found out that now there is a posibility to get the IP of the MP/GSP from the HP-UX servers, just in case you forgot or can't phisicaly access the server:
You need to have installed the sfm product:
SFM-CORE B.05.00.05 HPUX System Fault Management
It commes standard with the 11.23 FOE, so probably you have it by default.
Then you just lauch:
#/opt/sfm/bin/CIMUtil -e root/cimv2 HP_ManagementProcessor
Instance 0 :
UniqueIdentifier : 0.19.33.124.117.193
ControllerType : 3
OtherControllerType :
IPAddress : 10.10.11.250 <------ br="" ip="" mp=""> URL : http://10.10.11.250 <------ br="" ip="" mp=""> Dedicated : 14
CreationClassName : HP_ManagementProcessor
Name : Management Processor
EnabledState : 2
OperationalStatus : 2
- See more at: http://www.hpuxtips.es/?q=node/175#sthash.r8RDvWar.dpuf

Wednesday, June 5, 2013

"Change product key" link is not available in Windows 8 or in Windows Server 2012

Original KB text on location: http://support.microsoft.com/kb/2750773

Symptoms
When you try to change the product key in Windows 8 or in Windows Server 2012, you cannot find a "Change product key" link in the System item in Control Panel.

For example, you want to convert a default setup product key to a Multiple Activation Key (MAK) on a computer that is running Windows 8. However, you cannot find an element in the UI that lets you change the product key.


Cause
This issue occurs because the "Change product key" link is not displayed if Windows 8 or Windows 2012 is not activated.


Resolution
To change the product key without first activating Windows, use one of the following methods:
Method 1

    Swipe in from the right edge of the screen, and then tap Search. Or, if you are using a mouse, point to the lower-right corner of the screen, and then click Search.
    In the search box, type Slui.exe 0x3.
    Tap or click the Slui.exe 0x3 icon.
    Type your product key in the Windows Activation window, and then click Activate.

Method 2

Run the following command at an elevated command prompt:
Cscript.exe %windir%\system32\slmgr.vbs /ipk
Note You can also use the Volume Activation Management Tool (VAMT) 3.0 to change the product key remotely, or if you want to change the product key on multiple computers. 



How to use DiskSpd to simulate Veeam Backup & Replication disk actions

This HOW-TO contains information on how to use Microsoft© DiskSpd to simulate Veeam Backup & Replication disk actions to measure disk pe...