2012-03-01から1ヶ月間の記事一覧

vmware-tools更新時にエラーが出たので

vmware-toolsの更新時に下記のようなエラーが出た場合の対処。 # ./vmware-install.plA previous installation of VMware Tools has been detected.The previous installation was made by the tar installer (version 4).Keeping the tar4 installer databa…

月末だけcronで処理を実行する

月末だけcronで処理をさせたい時。 月末(28日~31日)の24時ちょい前に、翌日の日付が 1 の場合に実行すれば良さげ。 下記のような感じでできる。 59 23 28-31 * * /usr/bin/test `date -d tomorrow +\%d` -eq 1 && /path/to/script

DB/tableサイズを取得するSQL

PostgreSQL8.3~8.4にて。7.x、8.0~8.2、9.xは未確認。 全てのデータベースのサイズを取得するSQL SELECT datname, pg_size_pretty(pg_database_size(datname)) FROM pg_database; 特定のデータベースのサイズを取得するSQL SELECT pg_size_pretty(pg_datab…