Posted onInLinuxViews: Word count in article: 295Reading time ≈1 mins.
由于云平台的服务器经常会断网,得写个脚本定时登录。
登录脚本
1 2 3 4 5 6 7 8 9
#!/bin/bash # cd to the position of shell file # 保证在不同路径下执行该脚本(因为使用了相对路径)的一致性 cd `dirname $0` # cron 执行时使用的环境变量不包含 buaalogin,需绝对路径引用 # 由于已经切换到脚本所在目录,故相对路径生成的日志文件和脚本同目录 /usr/local/bin/buaalogin >> ./auto_login.log