[Seek Help] cp在crontab文件里的应用
Tofloor
poster avatar
solothink
deepin
2023-12-24 02:36
Author

在终端,使用cp -r -u /home/solothink/Documents/IT /run/user/1000/gvfs/smb-share:server=192.168.71.12,share=file/work,正常工作。但是如果在crontab里使用* * * * * cp -r -u /home/solothink/Documents/IT /run/user/1000/gvfs/smb-share:server=192.168.71.12,share=file/work,不工作。

给路径加上引号,也不行,转义符号\加上也不行。帮忙看看呢,谢谢各位。

Reply Favorite View the author
All Replies
想静静的回声
deepin
2023-12-25 17:28
#1

在corontab中, 命令需要使用全路径 , 比如 /usr/bin/cp 这样的。

如果不确定你使用的命令的路径, 可以使用 whereis 查询

Reply View the author
solothink
deepin
2024-02-04 09:37
#2
想静静的回声

在corontab中, 命令需要使用全路径 , 比如 /usr/bin/cp 这样的。

如果不确定你使用的命令的路径, 可以使用 whereis 查询

全路径也用过,不行的。不过现在解决了。用了其他办法。

Reply View the author