Skip to content

Instantly share code, notes, and snippets.

@sfpgmr sfpgmr/shp.cmd
Last active Aug 29, 2015

What would you like to do?
@ECHO off
rem 元ファイルとgzファイルを比較して元ファイルが新しいものだけをgzip化
rem もし.gzファイルがない場合は作る
rem 環境変数の遅延展開を可能にする
setlocal enabledelayedexpansion
for /R h:\pj\www\html %%1 in (*.*) do (
if "%%~x1" NEQ ".gz" (
set gzipf=%%1.gz
if EXIST !gzipf! (
for %%g in (!gzipf!) do (
set tf=%%~t1
set tgzip=%%~tg
if "!tf!" GTR "!tgzip!" (
@echo 日付が新しい: %%1
gzip -9Nfk %%1
) else (
@echo gzファイルが存在しない: %%1
gzip -9Nfk %%1
winscp /console /script="synchome.txt"
option batch on
option exclude ".git;.ntvs_analysis.dat;node_modules;data;obj;metrop;less;"
open scp://
synchronize remote h:\pj\www\html /var/www/html/ -delete -mirror -criteria=time
synchronize remote h:\pj\www\wwwnode /var/www/node/wwwnode/ -delete -mirror -criteria=time
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.