0

我有点不知道从哪里开始。我正在寻找解决方案

a) 将文件夹 A/ 中的特定文件复制到 B/ @ 修复日期/时间 b) 将文件夹 A/ 中的随机文件复制到 B/ @ 修复日期/时间

任何提示如何开始都会很受欢迎

CI

4

1 回答 1

0

将特定文件从 A 复制到 B 可以通过在 crontab 中附加一行来实现,具体取决于您希望它运行的时间。一般语法将是:

minute hour dayOfMonth month dayOfWeek (command to be executed)

在您的情况下,要执行的命令将如下所示:

cp /path/to/file/to/be/copied /path/to/destination

例如:如果您想在 11 月 20 日下午 3:35(15:35)复制文件,那么您的命令将类似于

35 15 20 11 * cp /path/to/file/to/be/copied /path/to/destination

查看此 wikipedia 链接,了解有关设置 cron 作业的出色解释。

于 2017-08-24T08:32:01.107 回答