当前位置:网站首页>利用 crontab 拷贝大文件
利用 crontab 拷贝大文件
2022-08-10 05:31:00 【开发老张】
场景
有些大文件在 SHELL 中使用 scp 命令传递时由于时间较长,会由于打开 SHELL 窗口的客户机关机等问题导致文件传输失败,因此可以利用 Linux 的 crontab 来让系统定时自动拷贝(如利用夜里时间),拷贝完成后删除掉 crontab 中的定时计划即可;
crontab 的格式:
- 分(0-59)
- 小时(0-23)
- 日期(1-31)
- 月份(1-12)
- 星期几(0-6,0 为星期天)
- 具体命令
crontab 查询命令:
crontab -lcrontab 编辑命令:
crontab -e1 19 1 8 1 /usr/bin/scp /data/file1.tar.gz [email protected]_server_ip:/home/data-bak/
1 20 1 8 1 /usr/bin/scp /data/file2.tar.gz [email protected]_server_ip:/home/data-bak/ 设置免密登录
还需要配置免密登录,才能自动执行拷贝命令
在设置 crontab 的服务器运行:
ssh-keygen -t rsa -P '' -f ~/.ssh/id_rsa
ssh-copy-id [email protected]_server_ip
边栏推荐
- pygame学习计划(1)
- 在yolov5的网络结构中添加注意力机制模块
- 自适应空间特征融合( adaptively spatial feature fusion)一种基于数据驱动的金字塔特征融合策略
- An article will help you understand what is idempotency?How to solve the idempotency problem?
- 基于Qiskit——《量子计算编程实战》读书笔记(一)
- 基本比例尺标准分幅编号流程
- Qiskit 学习笔记1
- 【写下自用】每次都忘记如何train?记录如何训练自己的yolov5
- Concurrency tool class - introduction and use of CountDownLatch, CyclicBarrier, Semaphore, Exchanger
- MongoDB 基础了解(一)
猜你喜欢

An article will help you understand what is idempotency?How to solve the idempotency problem?

如何模拟后台API调用场景,很细!

Pony语言学习(七)——表达式(Expressions)语法(单篇向)

Pony语言学习(一):环境配置(续)

pytorch框架学习(2)使用GPU训练

25张炫酷交互图表,一文入门Plotly

Joomla vulnerability reproduced
![[Thesis Notes] Prototypical Contrast Adaptation for Domain Adaptive Semantic Segmentation](/img/ac/51c2b2e4efed822f110d6963308eef.png)
[Thesis Notes] Prototypical Contrast Adaptation for Domain Adaptive Semantic Segmentation

pytorch框架学习(7) tensorboard使用

Qiskit 学习笔记1
随机推荐
聊聊 API 管理-开源版 到 SaaS 版
小记录:Pytorch做深度学习必要加载的包
cesium 添加点,移动点
pytorch框架学习(6)训练一个简单的自己的CNN (三)细节篇
OneFlow源码解析:算子指令在虚拟机中的执行
每周推荐短视频:探索AI的应用边界
oracle rac 11g安装执行root.sh时报错
AVL tree insertion--rotation notes
scikit-learn机器学习 读书笔记(二)
aliases node analysis
基于Qiskit——《量子计算编程实战》读书笔记(五)
conda创建虚拟环境方法和pqi使用国内镜像源安装第三方库的方法教程
OpenGauss source code, is it maintained with VSCode in the window system?
Abstract problem methodology
CORS跨域资源共享漏洞的原理与挖掘方法
常用工具系列 - 常用正则表达式
基于Qiskit——《量子计算编程实战》读书笔记(三)
Touch chip used in smart touch remote control
Jenkins 如何玩转接口自动化测试?
You can‘t specify target table ‘kms_report_reportinfo‘ for update in FROM clause