Friday, May 29, 2015

Backup And Compress Folder Contents To Another Location Via Batch Files Based On Date And Time

                                          For taking the backup of a folder contents to another local folder.Here we need to take data backup from “c:\wamp\www” to another local folder in Drive F: (F:\Backup).In destination location,the backed up folder names created Data and Time wise.Also zipped the destination folder.
  1. Created new test document and copy the below mentioned script into it
  2. Finally Save the file as a .bat extension
  3. Download and Install 7 Zip application software  
@echo off
@COLOR 0A
echo **** IT Tech Beats Backup Solution******
:: variables
set drive=F:\Backup

set year=%DATE:~10,4%
set day=%DATE:~7,2%
set month=%DATE:~4,2%
set hr=%TIME:~0,2%
set min=%TIME:~3,2%

set ICTOPS=%day%-%month%-%year%-%hr%-%min%

set backupcmd=xcopy /s /c /d /e /h /i /r /k /y
echo ### Backing up your Websites ...

"c:\Program Files\7-Zip\7z.exe"  a -t7z -r "%drive%\%ICTOPS%" "C:\wamp\www\*.*"
echo !!!!!!!!BACKUP COMPLETED.Your Backup is located at %drive% THANKS  !!!!!!!!
pause

Copy A Folder Contents To Another Location Via Batch Files

                   For copying the backup of a folder contents to another local folder.Here we need to take data backup from “c:\wamp\www” to another local folder in Drive F: (F:\Backup)
  1. Created new test document and copy the below mentioned script into it
  2. Finally Save the file as a .bat extension                  
@echo off
echo **** IT Tech Beats Backup Solution******
XCOPY C:\wamp\www\*.*  F:\Backup\*.* /s /e
echo !!!!!!!!BACKUP COMPLETED THANKS!!!!!!!!
Where
/s  ----> Copies folders and subfolders except for empty ones
/e  ----> Copies directories and subdirectories, including empty ones  

Thursday, May 21, 2015

Reset MySQL root Password In Ubuntu

                                  In Linux distributions you can recover the mysql root password using the following steps
  1. Stop all the MySQL processes
service mysql stop
     2.   Start MySQL server with –skip-grant-tables enabled
This option will let you login as root without any password
mysqld_safe --skip-grant-tables &
     3.   Connect to the MySQL server from your shell
mysql -u root
Eg :- root@ubuntu:~# mysql -u root
                     mysql>
      4.  Setup a new MySQL root password
use mysql;
            update user set password=PASSWORD("New Password") where User='root';
            flush privileges;
            exit
Eg :-    mysql -u root
mysql> update user set password=PASSWORD('amma') where user='root';
Query OK, 4 rows affected (0.02 sec)
Rows matched: 4  Changed: 4  Warnings: 0
      5.  Start all the MySQL processes
                       service mysql start
      6.  Test your new MySQL root password
mysql -u root -p

Tuesday, May 19, 2015

Clear Cached Credentials For A Network Share On A Windows Machine Without Rebooting

For checking the cached information's :-
  1. Open the command prompt (Run--->CMD)
  2. Execute the command : net use
  3. For Clearing cache :-  net use * /d
Eg:-
C:\>net use
New connections will be remembered.
Status       Local     Remote                    Network
-----------------------------------------------------------------------------
OK                     \\10.3.3.173\www          Microsoft Windows Network
Disconnected           \\192.168.172.219\IPC$    Microsoft Windows Network
The command completed successfully.
C:\>net use * /d
You have these remote connections:
                   \\10.3.3.173\www
                   \\192.168.172.219\IPC$
Continuing will cancel the connections.
Do you want to continue this operation? (Y/N) [N]:
bloggerwidgets