【问题标题】:shell script (running via cron) to enter password when prompted提示时输入密码的 shell 脚本(通过 cron 运行)
【发布时间】:2011-04-03 14:54:20
【问题描述】:

我有一个每日 cron 任务,它会自动解压缩 rar 文件并处理其内容,但是,内容现在受密码保护,所以我想知道是否有可靠的方法在提示时回显密码?密码提示来自我安装的、在 CentOS 上运行的 UNRAR 程序。感谢您的帮助!

【问题讨论】:

    标签: linux bash cron centos rar


    【解决方案1】:

    如果您使用unrar进行解包,您可以将密码定义为命令行参数:

    unrar x -ppassword package.rar
    

    请注意,-p 和您的 password 参数之间没有空格。

    【讨论】:

      猜你喜欢
      • 2017-08-11
      • 1970-01-01
      • 2012-08-09
      • 2012-04-28
      • 1970-01-01
      • 1970-01-01
      • 2019-07-23
      • 2010-09-18
      • 1970-01-01
      相关资源
      最近更新 更多