为什么crontab无法在我所需的目的地目录中显示我的rclone复制数据

发布于 2025-02-10 03:03:47 字数 706 浏览 2 评论 0原文

我已经编写了一个bash脚本,以在两个遥控器之间复制一个完整的目录,这些遥控器(即我可以在其上使用sbatch命令复制到所需目的地的文件夹)。但是,当我将其设置为crontab时,它并没有显示我的复制文件夹只会向我发送一条消息,显示该作业已提交。 这是我保存在file1.txt中的rclone命令

rclone --config=mykey.conf copy ./desiredtocopy/ /mydestination/: -P

,然后使用srun命令称此命令(file1.txt)我将其保存在另一个脚本mycopy.sh.sh中的srun命令如下:

srun bash /myproject/path/file1.txt

然后,我将每天运行的crontab设置为运行为如下:

* 5 * * * sbatch /myproject/path/file1.txt >> /myproject/path/file1.log 2>&1

不幸的是,我只收到了我的作业已提交的日志,但我在目的地(myproject/path/)中没有看到“ desiredtocopy”文件夹; 但是,如果我仅运行sbatch/myproject/path/file1.txt我将在目的地中看到“ DesiredTocopy”文件夹。

请我做错了什么。

I have written a bash script to copy a complete directory between two remotes which worked perfectly (i.e. I can see the folder I copied to my desired destination) when I use sbatch command on it. However, when I set this to crontab, it doesn't show my copied folder only sends me a message that the job has been submitted.
Here is the rclone command which i saved in file1.txt

rclone --config=mykey.conf copy ./desiredtocopy/ /mydestination/: -P

Then i called this command (file1.txt) using the srun command which i saved in another script called MyCopy.sh as follow:

srun bash /myproject/path/file1.txt

Then i set the crontab to run on daily basis as follow:

* 5 * * * sbatch /myproject/path/file1.txt >> /myproject/path/file1.log 2>&1

Unfortunately i only received the logs that my jobs has been submitted but i dont see the "desiredtocopy" folder in my destination (myproject/path/);
However if i run only sbatch /myproject/path/file1.txt i will see "desiredtocopy" folder in my destination.

Please what am i doing wrong.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文