荷兰校友的作业-3

Study the tar and the gzip commands. These connamds are the UNIX (Linux) version of pkzip or arj in Dos.
Write a script which backups you’re home directory into one compressed file in a subdirectory called backup of you’re home directory.
If you like you can study at and/or cron(tab) to schedule a daily or weekly backup of you’re home directory in one file.


我的答案:
#!/usr/local/bin/bash
CURRENTIME=`date “+%Y%m%d%H%M%S”`
if test ! -e ~/backup
then
mkdir ~/backup
fi
tar zcvf ~/backup/$CURRENTIME.tar.gz ~ –exclude=backup

发表回复

您的电子邮箱地址不会被公开。 必填项已用 * 标注

此站点使用Akismet来减少垃圾评论。了解我们如何处理您的评论数据