pastebin - collaborative debugging

pastebin is a collaborative debugging tool allowing you to share and modify code snippets while chatting on IRC, IM or a message board.

This site is developed to XHTML and CSS2 W3C standards. If you see this paragraph, your browser does not support those standards and you need to upgrade. Visit WaSP for a variety of options.

pastebin private pastebin - collaborative debugging tool What's a private pastebin?

Posted by Anonymous on Tue 8th Mar 23:36
download | new post

  1. @Echo Off
  2. SetLocal
  3. If "%~1"=="Archive" Shift&Goto :_Archive
  4. If "%~1"=="Delete" Shift&Goto :_Delete
  5. If "%~1"=="FirstRun" Shift&Goto :_FirstRun
  6. :: Edit paths as needed
  7. Set _Source=C:\Users\Lykaios
  8. Set _Dest=E:\Backups
  9. Set _Logfile=%_Source%\ArchiveLog.txt
  10. Set _Rar="C:\Program Files\WinRar\Rar.exe"
  11. :::::::::::::::::::::::::::::::::::::::::::::::::::::
  12. :: Do not Edit below this line
  13. :::::::::::::::::::::::::::::::::::::::::::::::::::::
  14. Set _Sep=  ===================================================================
  15. (Echo.
  16. Echo.Date: %date%
  17. Echo.Time: %Time%
  18. Echo.)>>"%_LogFile%"
  19. Set _Days=365
  20. 2>Nul ForFiles /P "%_Source%" /M *.log /D -%_Days% /C "Cmd /C Call %0 FirstRun @Path"
  21. 2>Nul ForFiles /P "%_Dest%" /M *.rar /D -%_Days% /C "Cmd /C Call %0 Delete @Path"
  22. Set _Days=7
  23. 2>Nul ForFiles /P "%_Source%" /M *.log /D -%_Days% /C "Cmd /C Call %0 Archive @Path"
  24. (Echo.
  25. Echo.%_Sep%)>>"%_LogFile%"
  26. Goto :EOF
  27. :_Archive
  28. Set _Fname=%~n1
  29. >Nul "%_Rar%" a "%_Dest%\%_Fname%.rar" "%~1"
  30. Del "%~1"
  31. >>"%_LogFile%" Echo "%~1" compressed to RAR file "%_Dest%\%_Fname%.rar"
  32. >>"%_LogFile%" Echo "%~1" deleted, More than %_Days% days old
  33. Goto :EOF
  34. :_Delete
  35. Del "%~1"
  36. >>"%_LogFile%" Echo "%~1" deleted, More than %_Days% days old
  37. Goto :EOF
  38. :_FirstRun
  39. Echo.Line=%*=
  40. Del "%~1"
  41. >>"%_LogFile%" Echo "%~1" deleted, More than %_Days% days old
  42.  
  43.  
  44. Result below from ArchiveLog.txt
  45.  
  46.  
  47. Date: 08/03/2011
  48. Time: 23:36:32.49
  49.  
  50.  
  51.   ===================================================================

Submit a correction or amendment below. (click here to make a fresh posting)
After submitting an amendment, you'll be able to view the differences between the old and new posts easily.

Use syntax highlighting

To highlight particular lines, prefix each line with @@


Remember my settings