查看積分策略說明發表回覆
Discuz! 代碼
提示插入
直接插入
說明訊息

插入粗體文本 插入斜體文本 插入下劃線 置中對齊 插入超級連結 插入信件位址 插入圖像 插入 flash 插入代碼 插入引言 插入列表
刪除線 直線分隔線 虛線分隔線
    
添加文字底框
內容 [字數檢查]:

表情符號

更多 Smilies
字型大小 |||
溫馨提示:本區開放遊客瀏覽。


文章關鍵字 : [功能說明]
(關鍵字可加強搜索準確性, 如關鍵字多於一組, 請以 , 作分隔, e.g. : 阿笨,shiuh,第一笨)

 關閉 URL 識別 | html 禁用
 關閉 表情符號 | 表情符號 可用
 關閉 Discuz! 代碼 | Discuz! 代碼 可用
使用個人簽名
接收新回覆信件通知
推薦放檔網絡空間

檔案(Torent, zip等)
  1. freedl
  2. multiupload
  3. btghost
  4. 便當狗
  5. mediafire
  6. pillowangel
圖片(JPG, GIF等)
  1. hotimg
  2. tinypic
  3. mousems2
  4. imageshack
  5. imm.io
>>>歡迎推薦好用空間


最新10篇文章回顧
azactam

 發表於 2008-10-15 03:27 PM

最近公司在搞資安,小小建議樓主把跟password有關的部份改成****比較安全喔!!


MU

 發表於 2008-10-13 09:28 PM

#!/bin/bash
#
# This program is created by VBird 2002/06/13
#
# What is this program?
#       This program will backup the following messages:
#       1. MySQL data files ( /var/lib/mysql );
#       2. HTTP's CGI-directory ( /var/www/cgi-bin )
#
# HOW TO RUN THIS PROGRAM?
#       Just put the file into /etc/crontab job,
#       or put this file's link file to /etc/cron.daily!
#
###############################################################
# History
#  Date         What                                    Who
#==============================================================
# 2002/06/13    First time to run this program
#               The only backup files are MySQL and CGI VBird
#==============================================================
# 0. Get the date messages and backup directory
day=`date +%Y-%m-%d`
backup_dir="/home/scn/disk2/backup/weekly"

#!欲備份的目錄
dir1="/var/www/html/sfs3"
#dir2="/var/lib/mysql/sfs3"

#!備份後的檔名
targetfile1="sfs3html-"`date '+%y-%m-%d'`.tar.gz
#targetfile2="sfs3data-"`date '+%y-%m-%d'`.tar.gz

#!執行tar打包
tar zcvf $backup_dir/$targetfile1 $dir1
#tar zcvf $backup_dir/$targetfile2 $dir2

#!mysql資料庫資訊
#databasename="sfs3"
#rootpassword="scl0380"

#!sql匯出後的檔名
#sqlfilename="sfs3sql-"`date '+%y-%m-%d'`.sql

#!以root身份利用mysqldump指令匯出sfs3資料庫資料
#mysqldump $databasename > $backup_dir/$sqlfilename -uroot -p$rootpassword

#!zip壓縮匯出檔

#zip $backup_dir/$sqlfilename.zip $backup_dir/$sqlfilename

#!只保留zip檔請執行下列指令 不刪除請保留#
#rm -rf $backup_dir/$sqlfilename


#!切換到存放目錄
cd $backup_dir


#!設定ftp帳號密碼與存放目錄
host="172.16.0.2"
user="administrator"
password="nt6908"
replace_dir="weekly"


#!啟動ftp連接

ftp -in << EOF
open $host
user $user $password
cd $replace_dir
bin
put $targetfile1

EOF


MU

 發表於 2008-10-13 09:26 PM

#!/bin/bash
#
# This program is created by VBird 2002/06/13
#
# What is this program?
#       This program will backup the following messages:
#       1. MySQL data files ( /var/lib/mysql );
#       2. HTTP's CGI-directory ( /var/www/cgi-bin )
#
# HOW TO RUN THIS PROGRAM?
#       Just put the file into /etc/crontab job,
#       or put this file's link file to /etc/cron.daily!
#
###############################################################
# History
#  Date         What                                    Who
#==============================================================
# 2002/06/13    First time to run this program
#               The only backup files are MySQL and CGI VBird
#==============================================================
# 0. Get the date messages and backup directory
day=`date +%Y-%m-%d`
backup_dir="/home/scn/disk2/backup/daily"

#!欲備份的目錄
#dir1="/var/www/html/sfs3"
dir2="/var/lib/mysql/sfs3"

#!備份後的檔名
#targetfile1="sfs3html-"`date '+%y-%m-%d'`.tar.gz
targetfile2="sfs3data-"`date '+%y-%m-%d'`.tar.gz

#!執行tar打包
#tar zcvf $backup_dir/$targetfile1 $dir1
tar zcvf $backup_dir/$targetfile2 $dir2

#!mysql資料庫資訊
databasename="sfs3"
rootpassword="scl0380"

#!sql匯出後的檔名
sqlfilename="sfs3sql-"`date '+%y-%m-%d'`.sql

#!以root身份利用mysqldump指令匯出sfs3資料庫資料
mysqldump $databasename > $backup_dir/$sqlfilename -uroot -p$rootpassword

#!zip壓縮匯出檔

zip $backup_dir/$sqlfilename.zip $backup_dir/$sqlfilename

#!只保留zip檔請執行下列指令 不刪除請保留#
rm -rf $backup_dir/$sqlfilename


#!切換到存放目錄
cd $backup_dir


#!設定ftp帳號密碼與存放目錄
host="172.16.0.2"
user="administrator"
password="nt6908"
replace_dir="daily"


#!啟動ftp連接

ftp -in << EOF
open $host
user $user $password
cd $replace_dir
bin
put $targetfile2
put $sqlfilename.zip
EOF





所在時區為 GMT+8, 現在時間是 2024-5-7 06:26 PM
清除 Cookies - 連絡我們 - TWed2k © 2001-2046 - 純文字版 - 說明
Discuz! 0.1 | Processed in 0.018974 second(s), 7 queries , Qzip disabled