カテゴリー: Raspberry pi
CATEGORY ARCHIVE
wordpress 用のデータをバックアップするためにExpectを使ってバックアップのためのス クリプトを作ったので掲載。 後はcronで自動実行。 To backup wordpress data easily, I created a script with Expect and post it to this site.
‘ install method in debian, ubuntu, raspbian $ sudo apt-get install expect
‘script ――――from here―――――――――――――――――- #!/usr/bin/expect set timeout 300 spawn sudo scp -r aaa@192.168.xxx.yyy:/abc /backups/xxx expect “aaa@192.168.xxx.yyy’s password:” send “password\n” expect “aaa@hostname ~ $” spawn sudo scp -r aaa@192.168.xxx.yyy:/defg /backups/xxx expect “aaa@192.168.xxx.yyy’s password:” send “password\n” expect “aaa@hostname ~ $” spawn sudo scp -r bbb@192.168.zzz.uuu:/abc /backups/zzz expect “bbb@192.168.zzz.uuu’s password:” send “password2\n” expect “bbb@hostname2 ~ $” exit 0 ――――――― until here―――――――――?
aaa, bbb, xxx, yyy, abc, defg, abc, hostname, hostname2 are dummy just for open for public.
投稿ナビゲーション
As the following warning appeared after introducing of a domain name, I fixed it by modifying of /etc/hosts.
Warning:
apache2: Could not reliably determine the server’s fully qualified domain name, using 127.0.1.1 for ServerName
Fix:
sudo nano /etc/hosts
before 127.0.1.1 host_name
after 127.0.1.1 domain_name host_name
Then restart apache.
投稿ナビゲーション
simle DNS
―――- server side ―― $ sudo apt-get update $ sudo apt-get install dnsmasq
$ sudo nano /etc/hosts
192.168.2.199 windows7pro 192.168.2.197 debian 192.168.2.198 centos6 192.168.2.192 ubuntu
――― linux client side ――
add dns-nameserver ‘IP of setted dnsmasq server’ なお、一番先頭にもってこないと、debian以外はうまくいかず
――――-added on 2016/3/13 ―――――― Don’t forget updating of /etc/resolv.conf ――――――――――――――――――――
――― windows client side ――
properties でDNSに追加
詳細設定のDNSのところで、さらに、 a single period (.) を追加が必要
―added on 2016/3/13―――――― at command prompt, the following command may be necessary ipconfig /flushdns
―added on 2016/3/19―――――――- If and When the dnsmasq server is rebooted, “ipconfig/flushdns” may be necessary. Though I don’t know why.
―-added on 2016/4/11――――――― I don’t know the reason,but windows side couldn’t resolve right IP address. Restarting of Windows was necessary.
投稿ナビゲーション