gpt4 book ai didi

Cron 服务没有执行我的脚本

转载 作者:行者123 更新时间:2023-12-04 19:43:56 24 4
gpt4 key购买 nike

我创建了一个 shell 脚本来移动和复制一些文件。我的脚本正在运行。每天我都手动运行它,因为 cron 没有完成它的工作(我可能做错了)。我的 shell 文件的权限为 777,所有文件夹,CRON/ROOT 的权限为 777。我正在运行 Cent OS 6.7 Final。我想每天早上 1:01 运行这个 cron。

我的脚本 (pdb.sh)

#!/bin/bash
/etc/init.d/pdb stop
mv /var/www/html/acesso/ui/root/mtaserver.conf /root/PDB/mods/deathmatch/mtaserver.conf
sleep 2
cp /root/PDB/mods/deathmatch/mtaserver.conf /var/www/html/acesso/ui/root/mtaserver.conf
sleep 2
mv /var/www/html/acesso/ui/root/admintag.lua /root/PDB/mods/deathmatch/resources/[RESOURCES]/022/admintag.lua
sleep 2
cp /root/PDB/mods/deathmatch/resources/[RESOURCES]/022/admintag.lua /var/www/html/acesso/ui/root/admintag.lua
sleep 2
chmod -R 777 /var/www/html/acesso/ui/root/
/etc/init.d/pdb start

crontab -l
Image Link

crontab -e
Image Link

最佳答案

Try putting /bin/sh in front of the script location. – Matt Schuchard

关于Cron 服务没有执行我的脚本,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41134556/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com