一、tar 打包压缩命令
压缩 解压缩
1、tar zcvf
2、zxvf
举例
创建目录 /code/www/html/ -p 这里-p是递归
创建 /code/www/html/下的文件 index_,文件内容12345
查看文件详细信息
切换到/code/www/文件下
把html文件压缩成 html.tar.gz格式
举例
讲html.tar.html文件解压到/opt/目录下
解压html.tar.gz文件到/opt/目录下
切换到/opt/目录下
查看/opt/目录详细信息
二、定时任务
定时任务口诀:分时日月周
* * * * * 表示任意时间 每
定时任务只能设置到分 不能秒
练习
crontab -e
#create by zhangya 2020-12-04 echo time mei fenzhong
* * * * * echo $(date) >>/tmp/time.log
观察是否每分钟执行
tail -f /tmp/time.log