定時拷貝刪除檔案命令

2021-10-02 00:17:01 字數 1829 閱讀 5223

拷貝資料夾,會把這個資料夾下的檔案拷貝到oss的img資料夾下要加/,不然會重新命名為img的檔案,而不拷貝iiimg資料夾本身

.

/ossutil64 cp /home/leite/iiimg/ oss:

//elatemall/img/

-rf.

/ossutil64 cp /home/leite/iiimg/ oss:

//elatemall/img/

-rf -

-update 增量上傳

./ossutil64 cp /home/leite/iiimg/ oss:

//elatemall/img/

-rf -

-maxupspeed 1024 設定限速

./ossutil64 cp /home/leite/iiimg/ oss:

//elatemall/img/

-rf -

-loglevel=debug 新增日誌

定時拷貝刪除檔案命令

定時刪除/home/leite/source/adslib/ 目錄下20天前的檔案,只刪除資料夾裡的檔案,不刪除資料夾

find /home/

-type f -mtime +20-

exec rm -rf \;

定時cp到oss的命令

/home/leite/ossutil64 cp -rf /home/leite/source/ oss:

//usa-spider/

--update -

-loglevel=debug

find /home/leite/source -

type f -mtime +3-

exec rm -rf \;

crontab -e示例

建立timing.sh

#! /bin/sh

cp /home/hepburn/桌面/

666.png /home/hepburn//

find /home/leite/source/adslib/

-type f -mmin +20-

exec rm -rf \;

需要給timing.sh新增可執行許可權

chmod 777 timing.sh

分 時 日 月 星期

每2分鐘執行*/

2***

*/home/hepburn/桌面/timing.sh >>

/home/hepburn/文件/timing.log 2

>&1

每2小時執行0*

/2**

*/home/hepburn/桌面/timing.sh >>

/home/hepburn/文件/timing.log 2

>&1

建立定時爬蟲兩種方法

/home/hepburn/

.local/

bin/ 是scrapy命令的位置

1.此種方法待驗證 ***

** cd /home/hyj/kids &

&/home/hepburn/

.local/

bin/scrapy crawl acw12.

spider.sh

#! /bin/sh

cd /home/hepburn/facebookads

nohup /home/hepburn/

.local/

bin/scrapy crawl fbads >>

/home/hepburn/facebookads/fbads.log 2

>&1

&建立crontab任務

定時刪除檔案指令碼

1.刪除指令碼 vi delete bin bash 刪除檔案 解釋 找到 fastdfds fastdfs 目錄下 10天前修改的 名字任意 並刪除 find fastdfs fastdfs mtime 1 name exec rm rf 刪除資料夾 find fastdfs fastdfs mt...

定時刪除檔案指令碼

1.刪除指令碼 vi delete bin bash 刪除檔案 解釋 找到 fastdfds fastdfs 目錄下 10天前修改的 名字任意 並刪除 find fastdfs fastdfs mtime 1 name exec rm rf 解釋 找到 fastdfds fastdfs 目錄下 大於...

linux指令碼定時刪除檔案

root ebs 46753 vi etc init.d delete.sh 內容 bin bash dir upload file images login qrcode 要刪除檔案的資料夾路徑 files ls for file in files doif e then rm f fidone ...