在linux平台下开发,我们经常会接触到一些任务性质的工作,而处理方式多样化。现积累各个案例。
 
从远程服务器拉取文件到本地服务器
  
scp work@cp01-xx-dev.com:/home/xx/data/relation/filename ./

 

 
清理近7天的数据
  
  日志文件越来越大,我们需要及时的去做清理工作。配合工具:find,xargs
 
#!/bin/bash
for p in `find ./ -type d -name log`; do
  find "$p" -mtime +7  | xargs -i rm -f {} &
done

  

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-01-22
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2018-03-25
猜你喜欢
  • 2022-12-23
  • 2021-11-08
  • 2022-12-23
  • 2022-12-23
  • 2021-10-07
  • 2021-07-23
  • 2021-12-11
相关资源
相似解决方案