似乎无法使用Ubuntu 16.04在我的油煎面包块外壳上运行我的cron文件

问题描述 投票:0回答:1

我编写了一个python脚本,它将更改我的Lxde油煎面包块外壳上的桌面墙纸,看起来运行得很好:

import os
from time import localtime
from pathlib import Path

wp = Path("/home/lucasmccallums/Desktop/projects/wallpaper_transitions")


hour = localtime().tm_hour

if (hour < 6) or (hour >= 21):
    os.system("pcmanfm --set-wallpaper=" + str(wp / "night.png"))

elif (hour >= 14):
    os.system("pcmanfm --set-wallpaper=" + str(wp / "afternoon.png"))

else:
    os.system("pcmanfm --set-wallpaper=" + str(wp / "morning.png"))

但是,当我尝试通过crontab运行它时,*/1 * * * * /usr/bin/python3 /home/lucasmccallums/Desktop/projects/wallpaper_transitions/desktopdemo.py它似乎安装得很好crontab: installing new crontab但是,它似乎仍然不起作用。我尝试使用命令/etc/init.d/cron start但是我面对cron: can't open or create /var/run/crond.pid: Permission denied

我将不断更新,尽我所能,但是任何帮助将不胜感激,谢谢!

python ubuntu cron ubuntu-16.04 crouton
1个回答
0
投票

在Crontab上

0 6,14,21 * * */usr/bin/somedirectory/py.....
© www.soinside.com 2019 - 2024. All rights reserved.