Skip to content

Instantly share code, notes, and snippets.

@yano3nora
Last active July 1, 2017 04:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yano3nora/36da6c8903760193d00907f68345643f to your computer and use it in GitHub Desktop.
Save yano3nora/36da6c8903760193d00907f68345643f to your computer and use it in GitHub Desktop.
[win: xcopy example] Attention on old code. #win

Purpose

標準機能だけで社内のWinサーバのHDD中身まるっとコピーして毎日夜中に外付けHDDとかにバックアップを取りたい。

Process of fool

  1. 新規ファイルを[ .bat ] 拡張子で作成して編集。

  2. XCOPYと言うコマンドを使って、ファイルをバックアップバッチシステムを作る

$ xcopy “バックアップ元” “バックアップ先” /D /S /E /H /C /Y /R
# ex) xcopy "%USERPROFILE%\My Documents" "E:\My Documents\" /D /S /E /H /C /Y /R
# これでマイドキュメントの中身が外付けHDDの中のMy Documentsフォルダにコピーされる
  1. タスクスケジューラに登録する Windows > すべてのプログラム > アクセサリ > システムツール > タスク スケジュールされたタスクの追加より作成した .bat ファイルを選択。
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment