linux系统如何设置每10分钟和每小时自动复制某目录下的文件呢?应该怎么做?

linux系统如何设置每10分钟和每小时自动复制某目录下的文件呢?应该怎么做?,第1张

crontab -e

00,10,20,30,40,50 * * * * cp /root/12 /var/12

注意修改一下路径和文件名,注意更改逗号(好像我输入的是全角,自己手工录入一下,不要copy)

find . -atime +5 -type d

find . -atime +1 -type f

-atime n

File was last accessed n*24 hours ago. When find figures out how many 24-hour periods ago the file was last accessed, any fractional

part is ignored, so to match -atime +1, a file has to have been accessed at least two days ago.

-type c

File is of type c:

b block (buffered) special

c character (unbuffered) special

d directory

p named pipe (FIFO)

f regular file

l symbolic linkthis is never true if the -L option or the -follow option is in effect, unless the symbolic link is broken. If you

want to search for symbolic links when -L is in effect, use -xtype.

s socket


欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/yw/5908809.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2023-03-08
下一篇 2023-03-08

发表评论

登录后才能评论

评论列表(0条)

保存