Tuesday, 4 July 2017

Delete temp files using group policy logon script

Or, Logon script for deleting temp files from windows directory using group policy
Or, Temp file deletion group policy for windows machines

Description: You can create a .bat file using the script given below and can use it in group policy logon script section.

Steps:
Open Notepad > Paste this script (modify the folders path as per your requirements) > save this file as tempdeletion.bat
----------------------------------------------------------------------------------------------------------------------
set folder="%temp%"
cd /d %folder%
for /F "delims=" %%i in ('dir /b') do (rmdir "%%i" /s/q || del "%%i" /s/q)
set folder="C:\Windows\Temp"
cd /d %folder%
for /F "delims=" %%i in ('dir /b') do (rmdir "%%i" /s/q || del "%%i" /s/q)
set folder="%localappdata%\Microsoft\Windows\INetCache\IE"
cd /d %folder%
for /F "delims=" %%i in ('dir /b') do (rmdir "%%i" /s/q || del "%%i" /s/q)
-----------------------------------------------------------------------------------------------------------------------

In my case, I have taken following temp directory path in the above script:
%temp%
C:\Windows\Temp
%localappdata%\Microsoft\Windows\INetCache\IE

Once you have the .bat script ready with you, you can use this script as logon script in any GPO and link with any OU as per your requirements.


Cheers, let me know if you have any query or feedback.

Saturday, 1 July 2017

Windows backup and restore types explained

Or, Understanding Windows backups types and concepts
Or, Different types of backups and restore methods used in backup technologies
Or, How many types of backups are and how restoration works

Descriptions: If you are new to backup administration and want to understand the fundamentals of different backup types and use cases, this article is for you. Guys, technically for Backup Administrators, there are three types of backup Full, Differential and Incremental but generally there are five type of backups as shown below.

1. Full or Normal Backup
2. Incremental Backup
3. Differential Backup
4. Copy Backup
5. Daily Backup

Full Backup: Full backup contains full data. Whenever you run Full backup, it takes backup of all selected files and folders every time. This type of backup consumes more disk space and takes longer time to complete.

Example: If you have schedule “Full Backup” to be executed on Monday of every week and total data size of the selected files/folders is 100GB, then every week you need 100GB of HDD space or tape media space to store this backup data.

Note: To restore complete data from full backup, you need only last recent “Full Backup” set.

Differential Backup: Diff backup contains only those data which was modified or created after “Full Backup”.  Every time you run differential backup, it compares itself with last recent full backup and backs up only those files/folders that was modified or created after last recent full backup.

Example: Your last full backup was completed on Monday with 100GB backup data and your next diff backup is scheduled to be executed on next Sunday. So, in next diff backup, only those files and folders will be backed up which has been modified or created after last full backup (Monday) and before diff backup execution (Sunday).  Suppose only 2 GB of data was modified after full backup, so in this diff backup only 2GB of data will be backed up not 102GB (100GB+2GB).

Note: To restore data from “Full Backup” + “Diff Backup” scenario, you have to have one set of last recent full backup and last recent “Diff backup”.

Incremental Backup:  Incremental backup contains only those data which was modified or created after full backup but in separate backup sets. Every time you run incremental backup, it compares itself with its last backup (whether is it full or incremental).

Example: If your last full backup was completed on Monday with 100GB backup data and your next incremental backup is scheduled to be executed on next Sunday. So, in next incremental backup, only those files and folders will be backed up which has been modified or created after last backup full/incremental backup.  Suppose only 2 GB of data was modified after full backup, so in this First incremental backup only 2GB of data will be backed up not 102GB (100GB+2GB).

Next incremental backup will be backing up only those data which would be modified or created after last incremental backup. Means, if data modified between last incremental backup is upcoming incremental back is only 3GB, then the upcoming incremental backup will have only 3GB data backup.

Note: To restore complete data from “Full Backup” + “Incremental Backup” Scenario, you have to have Last recent full backup and all incremental backup sets with you.  This backup combination consumes lesser disk or tape space and take lesser time to complete but complex to restore.

Daily Backup: When you simply copy files/folders to a different location rather than original on daily basis, is called daily backup.

Copy Backup: when you simply copy your files/folder to different location rather than original on your need basis, is called copy backup.


Cheers, Please write me back if you have any query on this.