![](/img/trans.png)
[英]How to use self-compiled Python from an Upstart script on Ubuntu 14.04
[英]How to calculate variable in Upstart script and use it?
有什么办法可以做到这一点?
一些细节:
我正在尝试使用名称为datetime的gunicorn创建日志文件。
那样的东西,但是不能正常工作:
chdir /home/mypath
script
log_file=./err_$(date +"%d_%m_%Y_%T").log
exec gunicorn --error-logfile $log_file
end script
这种方法也失败了:
exec gunicorn --error-logfile ./err_$(date +"%d_%m_%Y_%T").log
由于某种原因,由script
节启动的外壳无法在其路径中找到date
命令。 使用硬编码的路径:
script
log_file=./err_$(/bin/date +"%d_%m_%Y_%T").log
gunicorn --error-logfile $log_file
end script
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.