This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#N日前のログをTRAで固めて削除する | |
find ./access.log* -mtime +20|xargs tar cvzf 2011_access.log.tar.gz | |
find ./access.log* -mtime +20|xargs rm |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
VBA:【VBA関数いろいろ】 | |
Public Sub 選択範囲マッチング() | |
'************************************************************ | |
'* 選択範囲マッチング | |
'* | |
'* 第一引数:無し | |
'* 戻り値 :無し | |
'* -------------使用方法 | |
'* 適当なBookのマッチング対象としたい範囲を選択し | |
'* このModuleを実行する。 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
# -*- coding: UTF-8 -*- | |
#CSV | |
#モジュールをインポート | |
#デミリッターを使用してawkのような処理を行う事が可能 | |
import csv | |
#標準出力に出力したいのでsysをインポート | |
import sys | |
#ファイルの存在確認をしたいのでosをインポート |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
chmod u+x all-sys-bkup.sh |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#書式 | |
#<分> <時> <日> <月> <曜日> <コマンド> | |
#<分> 0~59までの整数 | |
#<時> 0~23までの整数 | |
#<日> 1~31までの整数 | |
#<月> 1~12までの整数 | |
#<曜日> 0~7までの整数 (0,7 : 日曜~6:土曜日) | |
#<コマンド> 実行するコマンド,シェルスクリプトなど。 | |
#-------------------------------------------------------- | |
#(日次例) 23時45分に毎日実行 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
rsync -avz -e 'ssh -p xx -i /hoge/hoge/.ssh/rsa' hoge.com:/hoge/bkup /hoge/hoge/VPSBkUp/week-1 | |
rsync -avz -e 'ssh -p xx -i /hoge/hoge/.ssh/rsa' hoge.com:/hoge/bkup /hoge/hoge/VPSBkUp/week-2 | |
rsync -avz -e 'ssh -p xx -i /hoge/hoge/.ssh/rsa' hoge.com:/hoge/bkup /hoge/hoge/VPSBkUp/week-3 | |
rsync -avz -e 'ssh -p xx -i /hoge/hoge/.ssh/rsa' hoge.com:/hoge/bkup /hoge/hoge/VPSBkUp/week-4 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# m h dom mon dow command | |
#書式 | |
#<分> <時> <日> <月> <曜日> <コマンド> | |
#<分> 0~59までの整数 | |
#<時> 0~23までの整数 | |
#<日> 1~31までの整数 | |
#<月> 1~12までの整数 | |
#<曜日> 0~7までの整数 (0,7 : 日曜~6:土曜日) | |
#<コマンド> 実行するコマンド,シェルスクリプトなど。 | |
#-------------------------------------------------------- |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
vi all-sys-bkup.sh | |
#!/bin/sh | |
tar czvplf /hoge/bkup/vpsBKUP.tar.gz --exclude hoge/bkup/vpsBKUP.tar.gz --exclude /dev --exclude /etc/network --exclude networks --exclude hosts --exclude /boot --exclude /home/swap --exclude /hoge/bkup --exclude /proc --exclude /sys --exclude /var/run --exclude /var/lock --exclude fstab / >bkup.lst |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
tar czvplf /hoge/bkup/vpsBKUP.tar.gz --exclude hoge/bkup/vpsBKUP.tar.gz --exclude /dev --exclude /etc/network --exclude networks --exclude hosts --exclude /boot --exclude /home/swap --exclude /hoge/bkup --exclude /proc --exclude /sys --exclude /var/run --exclude /var/lock --exclude fstab / >bkup.lst |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
※ローカルからサーバ側にファイルを送る | |
rsync -avz -e 'ssh -p xx -i /home/hoge/.ssh/hoge.com-rsa' /home/hoge hoge.com:/home/hoge |