当我从命令行执行下面的代码时,它要求我输入密匙密码。输入pasword后,它会发送电子邮件。
email2 <- compose_email(body = md("Brawo"))
email2 %>% smtp_send( to = "xxx", from = "xxx@gmail.com", subject = "x" , credentials = creds_key("gmail6") )
但是,当我通过Rscript执行它时,它将错误定义为
Error in b__file_set_keyring_pass(self, private, key, keyring) :
Aborted setting keyring password
Calls: %>% ... b_file_keyring_unlock -> <Anonymous> -> b__file_set_keyring_pass
Execution halted
我想在CRON中执行这个脚本,所以每次都不能手动输入密钥环密码。你能帮我一下吗?
发布于 2022-10-21 20:30:03
我给出了这个错误,因为我想要使用的键环被锁定了。
如果我想使用keyring,我需要使用keyring包中的keyring_unlock()函数来解锁它。
keyring_unlock(password= "your keyring password")
在此配置中,您将解锁默认的密钥环。
https://stackoverflow.com/questions/74131021
复制相似问题