使用Juniper junos 作業系統要更新版本有幾種方試
1.將Juniper SRX 開機當看到下列文字時按Space
loading /boot/defaults/loader.conf
loading /boot/defaults/loader.conf
changing password for root
new password:
confirm password:
(tmos)#
sh-3.2# passwdChanging password for user root.New BIG-IP password:Retype new BIG-IP password:Changing password for user root.passwd: all authentication tokens updated successfully.sh-3.2# rebootINIT: Sending processes the TERM signal
出處 :http://eeepage.info/binshm-bad-interpreter-no-such-file-or-directory/
在Linux中執行.sh腳本異常/bin/sh^M: bad interpreter: No such file or directory
分析:
這是不同系統編碼格式引起的:在windows系統中編輯的.sh文件可能有不可見字符,所以在Linux系統下執行會報以上異常信息。
解決:
1)在windows下轉換:利用一些編輯器如UltraEdit或EditPlus等工具先將腳本編碼轉換,再放到Linux中執行。
轉換方式如下(UltraEdit):File-->Conversions-->DOS->UNIX即可
2)也可在Linux中轉換:
首先要確保文件有可執行權限chmod a+x filename
然後修改文件格式vi filename
利用如下命令查看文件格式:set ff 或 :set fileformat
可以看到如下信息fileformat=dos 或 fileformat=unix
利用如下命令修改文件格式:set ff=unix 或 :set fileformat=unix
:wq (存檔退出)
最後再執行文件./filename
/usr/bin/script ~/Desktop/Terminal.log
This will log everything you do and append it to the log file. ~/Desktop/logger.sh
Here's the script:
#!/bin/bash
# logger.sh
# Log everything you do in Terminal.
#* Formatted date & time string.
FORMATTED_DATE=`/bin/date "+%Y-%m-%d%H%M%S"`
#* Archive the previous file
/bin/cp -f ~/Desktop/Terminal.log{,.$FORMATTED_DATE.txt}
#* Begin a new one
/usr/bin/script ~/Desktop/Terminal.log
[root@FB91lab02 /home]#vi /usr/local/sbin/backup-config
貼上下面的內容
bash -c 'tar -Pczf /root/freebsd-cfg-`date "+%Y-%m-%d"`.tgz --exclude={etc/gconf,usr/local/etc/transmission/home/{resume,torrents,Downloads,blocklists}} /etc/ /usr/local/etc/'
chmod +x /usr/local/sbin/backup-config
[root@FB91lab02 /home]#vi /etc/crontab
每周備份
# Backup the entire server configuration once a week. 0 1 * * 0 root backup-config 2>/dev/null