2016年10月24日 星期一

Robocopy 指令範例參考 (MIR問題很多,小心使用

http://bit.ly/2eB5PBZ

The /MIR switch is NOT a two way synchronization.  Right from the Microsoft documentation, it tells you /MIR is /e + /purge.  It does not delete files from the source.  The /MOV option DOES delete files from the source because you are moving them from the source to the destination.

C:\>robocopy C:\cmdCheckCaMainPID c:\Temp /s *.txt /MIR


 robocopy c:\Sourcepath c:\Destpath /E /XC /XN /XO
To elaborate:
  • /E makes Robocopy recursively copy subdirectories, including empty ones.
  • /XC excludes existing files with the same timestamp, but different file sizes. Robocopy normally overwrites those.
  • /XN excludes existing files newer than the copy in the source directory. Robocopy normally overwrites those.
  • /XO excludes existing files older than the copy in the source directory. Robocopy normally overwrites those.

With the Changed, Older, a

Set mm=%date:~4,2%
Set dd=%date:~7,2%
Set yyyy=%date:~10,4%
Set Year=%date:~10,4%
robocopy C:\Temp\VAE C:\Temp\VAE_Archive /MIR >> c:\Temp\%Year%-%mm%-%dd%-%yyyy%.log


set tdate=%date: =%
set tdate=%tdate:/=%
set ttime=%time::=%
set ttime=%ttime:.=%
set ttime=%ttime: =%
robocopy C:\Temp\VAE C:\Temp\VAE_Archive /MIR >> c:\Temp\%tdate%-%ttime%.log

2016年9月28日 星期三

backup c1240 firmware

https://supportforums.cisco.com/document/29186/how-backup-ios-images-autonomous-access-points

Step 2: Log into the access point through a Telnet session.
Step 3: Execute the following command from the privileged EXEC mode.
archive upload-sw tftp:[[//location]/directory]/image-name.tar
For //location, specify the IP address of the TFTP server.

https://mrncciew.com/2012/10/20/lightweight-to-autonomous-conversion/

http://www.cisco.com/c/en/us/support/docs/wireless-mobility/wireless-lan-wlan/107911-ios-upgrade.html

  1. with the access point from the other image in the flash.
  2. If you choose to overwrite the existing file, issue the archive download-sw /overwrite /reload tftp://location/image-name command. The /overwrite option overwrites the software image in flash with the downloaded image. The /reload option reloads the system after you download the image unless the configuration is changed and not saved. For //location, specify the IP address of the TFTP server. For image name, specify the Cisco IOS filename that you plan to use to upgrade the access point. In this example, the command is archive download-sw /overwrite /reload tftp://10.77.244.194/c1240-k9w7-tar.124-10b.JA3.tar. As mentioned earlier, do not change the name of the Cisco IOS file. Leave it as the default. You find these logs during the successful file transfer:

2016年9月21日 星期三

Windows Server 2008 with HTTP Default Web site running. Huge log file

https://social.technet.microsoft.com/Forums/systemcenter/en-US/d989b249-0159-41fc-b78c-1f1d91ce8bb3/inetpublogslogfilesw3svc1-getting-very-large?forum=configmgrgeneral

(extend read AT command)

Go To IIS console -> and Right click WebSite Property and click web site TAB find the Enable logging Next Step ->Uncheck the Enable Logging and restart the IISADMIN services after restart the service IIS log files are disbled



I trim mine with the following command which creates a scheduled task to do it :-

The mistake I found in Tom Watson's script is the added backslash \ before the Cmd.exe string resulting in the following:
ERROR: Invalid syntax. '/C' option is not allowed more than '1' time(s).
Type "FORFILES /?" for usage.
The fix, at least in my case was to remove the backslash \ as shown below.
Windows 2003  (if run now , cmd >  schtasks /RUN /TN "At1")
at 12:00 /EVERY:Su Forfiles.exe -p C:\WINDOWS\system32\LogFiles\W3SVC1 -m *.log -d -30 -c "Cmd.exe /C del @path\"

Windows 2008
at 12:00 /EVERY:Su Forfiles.exe -p C:\inetpub\logs\LogFiles\W3SVC1 -m *.log -d -30 -c "Cmd.exe /C del @path\"

This will run every Sunday, and will trim files in that folder older than 30 days.  Adjust to suit.

Regards,
Tom Watson,
E-Mail: Tom_... @...
Blog: http://myitforum.com/cs2/blogs/tom_watson
This was a great thread.  Cleared over 50 GB from a server today!  Thanks