Some critical files that I modify each day had to be backed up to a secure location, in case the file gets corrupted I can go to the archive and get the most recent backup.
I created a powershell script to do this. The script is pasted below.
#file name backup.ps1
$PathToGoalsSheet="C:\preformancereports\Akshay"
$FileToBeBackedUp="Goals.xlsx"
$BackupPath="D:\myComany\Dept\Backup"
$TodaysDateFormatted = Get-Date -format dd.MM.yyyy.HH.mm.ss
$BackupFolderName=[string]::Format("{0}.backup",$TodaysDateFormatted)
#Write($BackupFolderName)
if(Test-Path $PathToGoalsSheet)
{
if(Test-Path $PathToGoalsSheet\$FileToBeBackedUp)
{
Write("Creating folder ["+$BackupFolderName+"]...")
New-Item $PathToGoalsSheet\$BackupFolderName -type directory
Write("Copying File ["+ $FileToBeBackedUp +"] into ["+$BackupFolderName+"]...")
Copy-Item "$PathToGoalsSheet\$FileToBeBackedUp" "$BackupPath\$BackupFolderName"
}
else
{
Write("Could not find file ["+ "$PathToGoalsSheet\$FileToBeBackedUp" +"]!")
}
}
else
{
Write("The path ["+$PathToGoalsSheet+"] does not exist!")
}
The command to run this script file, I typed in a batch file (.bat), so I can run the powershell file (or schedule a task to run the batch file on a daily basis). The code in the batch file is as given below.
rem file name backup.bat
@echo off
set scriptHomePath=C:\PowerShell Scripts\
set backupFileScript=%scriptHomePath%backup.ps1
powershell -NoLogo -File "%backupFileScript%"
I note down things I come across each day, with my views on it. It can be anything that I feel I should write.
Wednesday, 29 June 2011
Backup a file using powershell script
Thursday, 23 June 2011
Calendar Active Exchange Sync on Android : Client/server conversion error
I happened to edit one of the occurences of a recurring meeting, in my mobile's calendar. My mobile is having Android Froyo (Android 2.2). After editing, I connected my phone to wifi and tried to sync the calendar. But when I tried to sync, the calendar will not successfully sync, but shows the error "Client/server conversion error".
This is how I solved the problem:
But not sure why a calendar item if I modify in my phone cannot be synced to the calendar in the exchange server.
This is how I solved the problem:
- In my phone, I navigated to Settings > Applications > Manage Applications. Selected 'All' tab which shows all the applications.
- After that I scrolled to Calendar in the list I did the following
- Seleted and opened the Calendar from the list.
- Clicked on 'Clear Data'.
- I repeated steps above 2(a) and 2(b) for 'Calendar Storage', 'Calendar Sync Adapter' & 'Calendar Widget' in the list of applications, that I had opened in step 1.
- I clicked the 'Home' button on my phone to go to the home screen. Then again navigated to Settings > Accounts & Sync > Exchange ActiveSync.
- Unchecked 'Sync calendar'
- Clicked 'Sync now' (synced Mail & Contacts only)
- Checked 'Sync calendar'
- Clicked 'Sync now' again. (synced Mail, Calendar & Contacts)
But not sure why a calendar item if I modify in my phone cannot be synced to the calendar in the exchange server.
Thursday, 16 June 2011
Adverts display products related to my recent views - Or "Ad that follow me"
I was initially surprised to see that the adverts displayed in some of the pages were related to products I had searched previously in some retail websites. I wondered how the ad could show the exact product I had viewed a few days ago. Sooner I noticed a small 'i' symbol in the right bottom corner which showed the message 'Would you like to learn more about why you are seeing this ad?'. I followed the link and finally disabled the ads that follow me. :-)
It was nice of criteo to provide a guide to disable the feature. Here is the link to disable the feature.
https://extranet.criteo.com/resources/docs/Process to block Criteo banner via Browser Options.pdf
It was nice of criteo to provide a guide to disable the feature. Here is the link to disable the feature.
https://extranet.criteo.com/resources/docs/Process to block Criteo banner via Browser Options.pdf
Subscribe to:
Posts (Atom)