Skip to content

Instantly share code, notes, and snippets.

@hdemon
Last active December 15, 2015 23:49
Show Gist options
  • Select an option

  • Save hdemon/5342848 to your computer and use it in GitHub Desktop.

Select an option

Save hdemon/5342848 to your computer and use it in GitHub Desktop.
hogeにsshで接続してファイルを指定条件で検索した後、それらのファイルをscpで持ってくるコマンド
ssh hoge 'find /var/log/nginx -name "access*" -mtime -30' | sed -e "s/\/var\/log\/nginx\///g" | xargs -I {} scp -P 22 fuga@localhost:/var/log/nginx/{} ./{}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment