V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX 提问指南
zhangjian
V2EX  ›  问与答

帮忙修改个 openwrt 自动上传脚本可好

  •  
  •   zhangjian · 2014-11-08 16:04:17 +08:00 · 3119 次点击
    这是一个创建于 3484 天前的主题,其中的信息可能已经有所发展或是发生改变。
    我实在找不出来问题在哪里 求大婶帮忙修改



    echo “start connect”
    my_current_date=`date +%Y_%m_%d`
    my_current_time=`date +%H_%M_%S`
    echo $my_current_date
    echo $my_current_time
    wget “http://10.0.0.1:8083/?action=snapshot” -O=/camcloud/photo.jpg
    echo “uploading…”
    wput /camcloud/photo.jpg ftp://user:[email protected]/wwwroot/$my_current_date/$my_current_time.jpg
    wput /camcloud/photo.jpg ftp://user:[email protected]/wwwroot/last.jpg
    echo “end”
    8 条回复    2014-11-08 19:53:37 +08:00
    orzfly
        1
    orzfly  
       2014-11-08 16:17:40 +08:00
    把你的引号先改成英文半角再说……
    fuxkcsdn
        2
    fuxkcsdn  
       2014-11-08 16:18:29 +08:00
    是脚本出问题还是crontab没达到预期效果?
    脚本出问题把错误帖出来

    crontab没达到预期效果,把wget和wput的路径写全,或者引入wget、wput所在的环境变量
    fuxkcsdn
        3
    fuxkcsdn  
       2014-11-08 16:20:08 +08:00
    @orzfly 帖出来的代码确实是英文半角啊...
    Daniel65536
        4
    Daniel65536  
       2014-11-08 16:27:48 +08:00
    crontab没达到预期效果可能是你被你的openwrt坑了。

    奇特版本的openwrt如果cat /etc/init.d/cron,会发现这么一段命令:
    rm -rf /etc/crontabs/root
    config_load cron
    config_foreach task_get task

    需要配置/etc/config/cron,或者把这三行注释掉重新crontab -e。
    oott123
        5
    oott123  
       2014-11-08 16:28:36 +08:00
    @fuxkcsdn 你把字体改改看=。=显然是全角的……
    “”
    ""
    fuxkcsdn
        6
    fuxkcsdn  
       2014-11-08 16:34:27 +08:00
    @oott123 好吧...确实是字体问题...FF和Chrome被我强制了字体
    你帖出来的我用FF的搜索,4个引号都被英文半角的双引号匹配到...
    到IE下看就能识别出来了...
    orzfly
        7
    orzfly  
       2014-11-08 16:37:55 +08:00
    @fuxkcsdn 浏览器的页内搜索现在会模糊匹配的,特别对于变种文字。

    ⑨ ❾ 9
    Ⅸ ⅸ ix
    zhangjian
        8
    zhangjian  
    OP
       2014-11-08 19:53:37 +08:00
    感谢以上所有v友的回答,谢谢。
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   4921 人在线   最高记录 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 41ms · UTC 09:36 · PVG 17:36 · LAX 02:36 · JFK 05:36
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.