我在 crontab 中有一个 mysqldump 行,但它不起作用,它只生成 0 个字节的文件:
0 0 * * * mysqldump -u 'USERNAME' -p'PASSWORD' database| gzip -c > /mysqldumb/backupfile.`date +\%a`.sql.gz >/dev/null 2>&1
我试图获取一个登录脚本来显示度数符号,但它不显示它。
Here is the weather.sh
METRIC="1" # 0 for F, 1 for C
# Fill in form to find your weather code here:
# http://netweather.accuweather.com/signup-page2.asp
# If code has a space remove it or replace it with %20 or a dash; -
LOCCOD="struer" #Example: NAM|MX|MX009|MEXICO-CITY
if [ "$weather" != "0" ] ; then
weather=`curl -s http://rss.accuweather.com/rss/liveweather_rss.asp\?metric\=${METRIC}\&locCode\=$LOCCOD \
| grep -E '<description>(Currently|High)' \
| sed -e 's/.*<description>\(.*\)/\1/' -e 's/\(.*\) <.*/\1/' -e 's/\(&#176;\)//'`
if [ "`echo "$weather" | wc -l`" -eq "3" ] ; then
echo "Weather......: `echo "$weather" | head -1`"
echo "Today........: `echo "$weather" | head -2 | tail -1`"
echo "Tomorrow.....: `echo "$weather" | tail -1`"
fi
fi
但是当我登录时它只显示:°C
但如果我这样做:echo $'\xc2\xb0'C
在腻子中,它显示正常吗?
什么给了,我该如何解决?