2014-12-23 70 views
0

我想用cron來下載並解壓然後將我的服務器direcotry,如何設置crontab的目標目錄,用的cPanel

我所做的:

wget http://geolite.maxmind.com/download/geoip/database/GeoLiteCity.dat.gz - 
|gunzip GeoLiteCity.dat.gz && 
mv GeoLiteCity.dat 37.18.176.133/~work/wp-content/plugins/shabatkeeper/GeoLiteCity.dat 

我得到什麼:

--2014-12-22 11:00:03-- 
    http://-/ Resolving -... failed: Name or service not known. 
    wget: unable to resolve host address `-' 
    FINISHED --2014-12-22 11:00:03-- 
    Downloaded: 1 files, 11M in 1.1s (10.7 MB/s) 

如何設置目標目錄?

回答 - 做了什麼ID:

  1. 下載的文件與

    wget http://geolite.maxmind.com/download/geoip/database/GeoLiteCity.dat.gz

  2. 進入的cPanel文件瀏覽器,並檢查該文件GeoLiteCity.dat.gz是。

3.then鋸哪個目錄是家庭及其怎麼叫,發現我所需要的路徑是 /home/work/www/

就是這樣

+0

您運行的是哪個版本的shell和OS?請編輯該問題。 – bmike

回答

0

這應該做你要找什麼

wget -q -O- http://geolite.maxmind.com/wnload/geoip/database/GeoLiteCity.dat.gz | gunzip> /path/to/where/you/want/GeoLiteCity.dat

+0

tx for your answer itryes and I get:'/ bin/sh:http://37.18.176.133/~work/wp-content/plugins/shabatkeeper/GeoLiteCity.dat:No such file or directory' – DrMosko

+0

http:// 37.18.176.133/~work/wp-content/plugins/shabatkeeper/GeoLiteCity.dat不是文件系統上的正確路徑。它會像/ home/username/www或/ var/www /〜工作 –

+0

謝謝你的回答,我如何才能找到正確的路徑 – DrMosko