修改权限及所有者
将backup目录修改为www组下面的www用户
chown -R www:www /home/wwwroot/www.5yun.org/web/backup
将web目录设置为755权限,-R表示向下递归
chmod -R 755 /home/wwwroot/www.5yun.org/web/
查看centos版本
cat /etc/redhat-release
重启系统
shutdown -r now
系统关机
shutdown -h now
仅打包,不压缩
tar -cvf /home/wwwroot/www.5yun.org/web/backup/etc.tar /home/wwwroot/www.5yun.org/web/backup
tar压缩文件夹但排除某文件
–exclude排除文件命令
tar -zcvf /home/download/2016-1-22.tar.gz --exclude=/home/download /home
wget下载整个FTP目录
注:-r 表示下载目录 -c 断点续传
wget <ftp用户名+密码+目录地址> -r -c
删除文件夹
rm -rf /var/log/httpd/access
删除文件
rm -f /var/log/httpd/access.log
删除文件夹下所有的内容
rm -rf /root/*
时区修改
将系统时间设置为东八区中国时间
cp -f /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
查看系统时间
date
定时执行脚本
vim /etc/crontab
SHELL=/bin/bash
PATH=/sbin:/bin:/usr/sbin:/usr/bin
MAILTO=root
HOME=/
# For details see man 4 crontabs
# Example of job definition:
# .---------------- minute (0 - 59)
# | .------------- hour (0 - 23)
# | | .---------- day of month (1 - 31)
# | | | .------- month (1 - 12) OR jan,feb,mar,apr ...
# | | | | .---- day of week (0 - 6) (Sunday=0 or 7) OR sun,mon,tue,wed,thu,fri,sat
# | | | | |
# * * * * * user-name command to be executed
01 0 * * * root /data/backup/backup1.sh
01 0 * * * root /data/backup/backup2.sh
© 版权声明
文章版权归作者所有,未经允许请勿转载。
THE END