發表文章
FreeNAS 設定自動開關機以節省電力
- 取得連結
- X
- 以電子郵件傳送
- 其他應用程式
⒈按DEL進入BIOS選單 ⒉進入Power功能表 ⒊點選 Power On By RTC Alarm [Disabled],預設是 [Disabled],要改為 [Enabled],再來就要改 RTC Alarm Date 和 System Time。 以下節自主機板的說明書。 Allows you to enable or disable RTC to generate a wake-up event. Configuration options: [Disabled] [Enabled] The following items appear only when the Resume On RTC Alarm item is set to [Enabled]. RTC Alarm Date [15] To set the alarm date, highlight this item and press the <+> or <-> key to make the selection. ⒋我的設定是下班時間開機,晚上就寢時間關機,這樣至少省掉一半的電力。 ⒌讓FreeNAS自動關機的設定部分參考 http://www.youtube.com/watch?v=qlOoj7s90rY
mysql 的 binary log 檔
- 取得連結
- X
- 以電子郵件傳送
- 其他應用程式
Debian GNU/Linux 預設 mysql 的 binary log 檔會保留10天 ( /var/log/mysql/mysql-bin.xxxxxx ),當硬碟空間(/var分割區)不是很大且mysql的資料量又不小時,常常因為保留太多的 binary log 而造成空間不足。 解 法如下: (開啟 mysql設定檔) vi /etc/mysql/my.cnf (找到以下部份) # The following can be used as easy to replay backup logs or for replication. #server-id = 1 log_bin = /var/log/mysql/mysql-bin.log # WARNING: Using expire_logs_days without bin_log crashes the server! See README.Debian! expire_logs_days = 10 max_binlog_size = 100M #binlog_do_db = include_database_name #binlog_ignore_db = include_database_name (把預設保留天數改成3天) expire_logs_days = 3 改 完之後記得重新啟動 mysql 就一切搞定了。 (重新啟動時就會自動刪去超過3天的 binary log) 另外1… mysqladmin flush-logs 可以立刻 rotate binary log ,如果確定 rotate 過的 log 是不需要的備份,那就能隨意刪除了。 另 外2… 底下這篇有很棒的教學,教我們如何自 binary log 中把資料庫還原回來。 Source: Restoring lost data from the Binary Update Log % mysqlbinlog hostname-bin.001 重播資料庫變動過程 % mysqlbinlog --database=phpBB2 hostname-bin.108 重播 p...
Samba、OpenWebMail UTF8 化
- 取得連結
- X
- 以電子郵件傳送
- 其他應用程式
利用 Samba 來實作網路硬碟很方便,不過,只能在區網使用,這時可以搭配 OpenWebMail 的網路硬碟Web 介面,或是利用 FTP 軟體 FileZilla 來遠端傳送檔案。 我實作的環境是 FreeBSD,目前跑起來還ok,其實設定檔的參考來源大部分來自於網友的資料,我這邊只是稍微統整一下,有錯誤的地方請大家幫忙指正。 FreeBSD 內建的 editor vi 不支援顯示中文,所以我會安裝 vim 來取代 vi。 Server 端部分: 一、Samba 的設定,修改 smb.conf # Charset settings ; display charset = koi8-r ; unix charset = koi8-r ; dos charset = cp866 # Charset settings display charset = UTF8 unix charset = UTF8 dos charset = UTF8 二、pure-ftpd 的設定 # FileSystemCharset big5 # ClientCharset big5 FileSystemCharset utf-8 ClientCharset big5 三、OpenWebMail 的檔案系統預設字集,也要改成 utf-8 利用OpenWebMail 提供的工具 fixrc.pl 來將所有人的設定改成 utf-8 perl fixrc.pl fscharset=big5 fscharset=utf-8,改別的設定,方法也是依此類推。 Client 端部分: 一、利用顏國雄老師的 netlogon 程式登入網路硬碟,還蠻方便的,感謝游老師的介紹。沒那個程式,就得自己到網路上找別人寫的登入批次檔,或者是自己寫了。 二、在遠端的話,就利用 OpenWebMail 的 Web 介面,或者是安裝 FileZilla 吧,FileZilla 一裝好,就支援 UTF8 囉。 從此之後,資料夾或是檔案名稱,可以自由取名了,big5 檔案系統帶來的怪問題就此消失,不過,透過 IE 的 FTP 介面來存取資料就不能使用了。
rsync examples
- 取得連結
- X
- 以電子郵件傳送
- 其他應用程式
rsync examples backup to a central backup server with 7 day incremental #!/bin/sh # This script does personal backups to a rsync backup server. You will end up # with a 7 day rotating incremental backup. The incrementals will go # into subdirectories named after the day of the week, and the current # full backup goes into a directory called "current" # tridge@linuxcare.com # directory to backup BDIR=/home/$USER # excludes file - this contains a wildcard pattern per line of files to exclude EXCLUDES=$HOME/cron/excludes # the name of the backup machine BSERVER=owl # your password on the backup server export RSYNC_PASSWORD=XXXXXX ######################################################################## BACKUPDIR=`date +%A` OPTS="--force --ignore-errors --delete-excluded --exclude-from=$EXCLUDES --delete --backup --backup-dir=/$BACKUPDIR -a" export PATH=$PATH:/bin:/usr/bin:/usr/local/bin # the following line clears the last weeks incremental directory [ -d $HOME/em...