全自動スクリプトを使って公開済みプログラムとライブラリをバックアップする

概要

プログラムとライブラリのバックアップを作成したいことがあります。 その為にブラウジングするのは単調で面白くありません。 そこで全自動バックアップスクリプトを設計しました。

機能

  • シェルスクリプトベースの全自動バックアップ
  • 公開済みプログラムとライブラリが対象
  • ターゲットユーザ名を選択可能

プラットフォーム

  • Linux (Ubuntu 10.10, FreeBSD 8.1上でテスト済み)
  • MacOS (Mac OS X上でテスト済み。MacPortsを使用。)
  • Cygwin on Windows (たぶん...)

スクリーンショット

準備

/media/uploads/shintamainjp/mbed_backup_screenshot0.png

実行

/media/uploads/shintamainjp/mbed_backup_screenshot1.png

結果

/media/uploads/shintamainjp/mbed_backup_screenshot2.png

どうやって使うの?

  1. このページのZIPファイルをダウンロードして下さい。
  2. ZIPファイルからスクリプトを取り出します。
  3. ターゲットユーザ名を指定してスクリプトを実行します。
  4. ターミナルで結果を確認します。

リソース


11 comments on 全自動スクリプトを使って公開済みプログラムとライブラリをバックアップする:

28 Dec 2010

これは便利! FreeBSD 8.1 でも問題ありませんでした。 ( wget が必要です)

29 Dec 2010

h.sugaさん

御報告ありがとうございます。 確かにディストリビューションによってはwgetは最初に入っていないかも・・・。 こういったレポートは非常に助かります。 ありがとうございます。

なかむら

29 Dec 2010

便利便利!Mac OS X でも動きました!! 確かにMacでもwgetは最初から入ってないのでインストールする必要があります.(多少の面倒がありますがMacPortsが便利です)
..当初,当方の環境ではwgetの初期設定ファイル".wgetrc"が存在し「convert_links = on」としていたため,ファイル取得後にwgetが終了してくれなくて少し悩みました(「そのような初期設定ファイルを作ってあったことさえ忘れてた」という問題でした) (^_^;;

30 Dec 2010

Tedd OKANOさん

Macは今のところ1台もありませんのでどうしようかと思っていました。 大変助かりました。 h.sugaさんの情報と共にNotebookの情報をアップデートさせて頂きますね! ありがとうございます!

なかむら

30 Dec 2010

Okano San could you please explain how you did it with macports? Thank you

30 Dec 2010

Hi Voy,

This is a nice shell script to backup the published program and library. I tried to run this script on my Mac to make sure it works because Shintamainjp said "It SHOULD work on MacOS too".
On this (mbed_backup.sh) shell script, it uses "wget" to download the files from server. This is a UNIX tool but it is not included default environment of Mac.

On the Mac, there are sevaral way to install/manage these kind of tools. In my case, using MacPorts.
I installed "wget" by MacPorts and it works fine but before I could find this script works, I needed to do one thing: modify my setting file "/.wgetrc". It was having "convert_links = on" that let the wget keep waiting after file retrieve. This is what I noticed.
If you don't have such your preference file or you are just after the wget installed, you don't need to this kind of thing.

Tedd

30 Dec 2010

Hi Tedd I installed wget via MacPorts (sudo port install wget) and it was done perfect. Now i tried to call the sh file from Terminal. It failed. Can you give me some help how to call the script? I am a real newbie with a Mac so i am having a bit of trouble with this system. Thank you

31 Dec 2010

Dear Mr.voy-san

Hi. :) Thank you for your post.

What's the error message?

Quote:

Mode of the script file

Did you changed the mode of the script file? http://en.wikipedia.org/wiki/Chmod Could you try the following commands on the terminal?

 chmod a+x mbed_backup.sh
 ./mbed_backup.sh microfreak

Quote:

Current directory

Where is the your working directory on the terminal? Please check your current directory with 'pwd' command. Also you can change the directory with 'cd' command.

Regards Shin.

31 Dec 2010

Hi Shinichiro

after your helpful assistance everything is now working perfect. I had not changed the script mode. Thank you very much. I wish you and your family a happy new year.

voy

31 Dec 2010

Hi Voy, Good news! Enjoy mbed and Mac life!
Hi Shin, Thank you for follow up.
/Tedd

31 Dec 2010

Hi voy-san!

Great! I should upgrade my document. :)

Hi Tedd-san!

Thank you for your great support. It's really helpful. :)

Shin.

Please log in to post comments.