cp

How can I use a cronjob when another program makes the commands in the cronjob fail?

谁都会走 提交于 2021-02-11 17:00:42
问题 I have a cron job which cd into a directory and performs actions. For example: 0 12,00 * * * cd /var/lib/test/0001 && cp *.zip /home/bobby/ However, the program that creates the .zip files in /var/lib/test/0001 changes the directory name every day. So on the second day, the directory is /var/lib/test/0002 and on the third day /var/lib/test/0003 and so on. This model cannot be changed. Of course, when the directory migrates from 0001 to 0002 , the cronjob fails. Is there a way to use cron to

How can I use a cronjob when another program makes the commands in the cronjob fail?

心已入冬 提交于 2021-02-11 16:58:42
问题 I have a cron job which cd into a directory and performs actions. For example: 0 12,00 * * * cd /var/lib/test/0001 && cp *.zip /home/bobby/ However, the program that creates the .zip files in /var/lib/test/0001 changes the directory name every day. So on the second day, the directory is /var/lib/test/0002 and on the third day /var/lib/test/0003 and so on. This model cannot be changed. Of course, when the directory migrates from 0001 to 0002 , the cronjob fails. Is there a way to use cron to

目录处理命令

十年热恋 提交于 2020-12-25 12:04:40
创建目录:mkdir mkdir -p [目录名] -p 递归创建 命令英文愿意:make directories 切换目录:cd cd [目录] 命令英文原意:change directory 简化操作: cd: 进入当前用户的家目录 cd 目标目录:进入目标目录 cd -:回到上一次所在的目录 cd ~:进入当前用户家目录 cd . :进入当前目录 cd . .:进入上一级目录 查看所在目录位置:pwd pwd 命令英文原意:print working directory 注:pwd查看的是绝对路径。 绝对路径:从根目录开始制定,一级一级递归查找。在任何 目录下,都能进入指定位置。 如: [root@localhost~]#cd /etc/ 相对路径:参照当前所在目录,进行查找。 如:[root@localhost~]#cd ../usr/local/src/ 删除空目录:rmdir rmdir [目录名] 命令英文原意:remove empty directories 删除文件或目录:rm rm -rf [文件或目录] -r:删除目录 -f:强制删除 命令英文原意:remove 复制命令:cp cp [选项] [原文件或目录] [目标目录] 命令英文原意:copy 选项: -r 复制目录 -p 连带文件属性复制 -d 若原文件是链接文件,则复制链接属性 -a 相当于-dpr

How can i copy only header files in an entire nested directory to another directory keeping the same hierarchy after copying to new folder

我们两清 提交于 2020-08-22 05:48:19
问题 I have a directory which has a lot of header files(.h) and other .o and .c files and other files. This directory has many nested directories inside. I want to copy only header files to a separate directory preserving the same structure in the new directory. cp -rf oldDirectory newDirectory will copy all files. I want to copy only header files. 回答1: (cd src && find . -name '*.h' -print | tar --create --files-from -) | (cd dst && tar xvfp -) You can do something similar with cpio if you just

gsutil cp command error, CommandException: NO URLs matched:

扶醉桌前 提交于 2020-08-08 07:13:52
问题 Good day, I am not a developer but running simple gsutil command to manage my google cloud storage . I ran into an issue where I run the following command form the cmd gsutil -m cp -r gs:/bucket/ . Scenario1: with most buckets this goes just fine Scenario2: there is one bucket where I get an error and I really have no clue how this is possible the error I get is: CommandException: NO URLs matched: gs://content-music.tapgamez.com/ I am hoping anyone can share their thoughts with me thnx 回答1: