免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 1350 | 回复: 0
打印 上一主题 下一主题

[系统管理] AIX System Security:backup file shell [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2006-11-07 10:35 |只看该作者 |倒序浏览
#!/bin/ksh
# Create date-specific backup timestamp extension
EXT=`date '+%Y%m%d-%H:%M:%S'`
# Backup individual files
for FILE in \
/etc/ssh_config /etc/sshd_config \
/etc/openssh/ssh_config /etc/openssh/sshd_config \
/etc/inetd.conf /etc/hosts.deny /etc/hosts.allow \
/etc/sendmail.cw /etc/sendmail.cf \
/etc/exports /etc/inittab \ /etc/profile \
/etc/rc.net-tune /etc/syslog.conf \
/usr/sbin/shutdown /etc/passwd /etc/group \
/etc/hosts.equiv /etc/ftpusers \
/etc/dt/config/Xconfig /etc/dt/config/Xservers \
/usr/dt/config/Xservers \
/usr/lib/security/mkuser.sys \
/etc/motd /etc/csh.login /etc/profile \
/etc/ftpd.cat \
/etc/rc.tcpip \
/etc/syslog.conf
do
if [ -f ${FILE} ]; then
echo Making backup of file ${FILE}
cp -p ${FILE} ${FILE}-preCIS-${EXT}
chmod 700 ${FILE}-preCIS-${EXT}
fi
done
# Backup directories that are changed
for DIR in \
/etc/security /var/spool/cron/crontabs
do
echo Making backup of directory ${DIR}
mkdir -p -m 0700 ${DIR}-preCIS-${EXT}
cd ${DIR}
tar cpf - * | (cd ${DIR}-preCIS-${EXT}; tar xpf -)
done

本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u/4031/showart_196616.html
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP