Permission denied error when running crontab [duplicate]

非 Y 不嫁゛ 提交于 2019-12-02 18:01:39

问题


I have created an r-script in the folder "csv_file"

marc@Marc-Linux:~/csv_file$ ls
8388.26580527145.csv  csv_file.Rproj  excel  source  write_csv2.R

Now I would like to create a crontab that executes this file every five minutes till 10am. Therefore I wrote the following

  #open crontab
  crontab -e
  #add to file
  */5 10 * * * ~/csv_file/write_csv2.R

This however does not seem to work. That makes sense cause when I try to run

  marc@Marc-Linux:~$ ~/csv_file/write_csv2.R

I get the following error:

  -bash: /home/marc/csv_file/write_csv2.R: Permission denied

Any thoughts what goes wrong here?


回答1:


make it executable first, using

chmod +x  ~/csv_file/write_csv2/filename.r

and the execute it using ./filename.r



来源:https://stackoverflow.com/questions/36933153/permission-denied-error-when-running-crontab

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!