SubVersion¶¨ÆÚÍêÕû±¸·Ý½Å±¾(Linux)
½Å±¾¹¦ÄÜ: ¶¨ÆÚ¶ÔһЩÏîÄ¿½øÐÐÍêÕû±¸·Ý.
project.lst Îļþ¸ñʽÈçÏÂ:
project1
project2
±¸·Ý½Å±¾ÈçÏÂ:
#!/bin/sh
#
# subversion data backup script
# by scud http://www.jscud.com
# 2005-11-27
#
# subversionÍêÕû±¸·ÝµÄ½Å±¾,µ÷ÕûºÃºóʹÓÃcrontab -e ·Åµ½×Ô¶¯Ö´ÐÐÀïÃæ¼´¿É.
#
#±¸·ÝÈÕÖ¾Îļþ
LogFile=/backup/svn/svnbak.log
DATE=`date +%Y%m%d`
#±¸·ÝĿ¼
BakDir=/backup/svn/data
#ÈÕ³£±¸·ÝĿ¼,Èç¹ûÓÐ
DailyDir=/backup/svn/daily
#Òª±¸·ÝµÄÏîÄ¿ÁбíÎļþ,Ö»ÓÐÏîÄ¿Ãû
ProjectLst=/backup/svn/project.lst
#ËùÓÐÏîÄ¿¶¼±£´æÔÚÕâ¸öĿ¼ÏÂ
SvnDir=/var/svn
#svnadmin³ÌÐòµÄ·¾¶
SVNADMIN=/app/subversion/bin/svnadmin
echo " " >> $LogFile
echo " " >> $LogFile
echo "-------------------------------------------" >> $LogFile
echo $(date +"%y-%m-%d %H:%M:%S") >> $LogFile
echo "--------------------------" >> $LogFile
cd $BakDir
#¶ÁÈ¡ÏîÄ¿Áбí
PROJECTLIST=`cat $ProjectLst`
for project in $PROJECTLIST
do
projectdata=$SvnDir/$project
destdir=$BakDir/$project
dumpfile=$DATE.$project.tgz
if [ -f $BakDir/$dumpfile ]
then
echo "backup file have exist!" >>$LogFile
else
$SVNADMIN hotcopy $projectdata $destdir --clean-logs
tar czvf $dumpfile $destdir >/dev/null
rm -fr $project
echo "backup $project done into $dumpfile ">>$LogFile
fi
## delete old tgz ´Ë´¦¸ù¾ÝcrontabµÄʱ¼äµ÷Õû,ÀýÈçÒ»ÖÜÒ»´Î±¸·Ý,´Ë´¦±£ÁôÁË5·Ý±¸·Ý,ÒÔÇ°µÄɾ³ý
oldfile="$BakDir/"$(date +%y%m%d --date=’28 days ago’).$project.tgz
if [ -f $oldfile ]
then
rm -f $oldfile >> $LogFile 2>&1
echo "[$oldfile]Delete Old File Success!" >> $LogFile
else
echo "[$oldfile]No Old Backup File!" >> $LogFile
fi
done
#delete previous daily backup files
cd $DailyDir
rm -f *
¸ù¾Ý×Ô¼ºµÄÉèÖÃÅäÖúúó,ʹÓÃcrontab ·Åµ½¶¨Ê±Ö´ÐеÄÈÎÎñÀï¼´¿É.
Ïà¹ØÎĵµ£º
×ܽáÕ½ڣºµÚÒ»Õ É豸Çý¶¯³ÌÐò¼ò½é
µÚ¶þÕ ¹¹ÔìºÍÔËÐÐÄ£¿é
Ìáµ½Çý¶¯³ÌÐò¾Í²»µÃ²»ÏÈ˵ÏÂÁ½¸öÃû´Ê£ºÄں˿ռäºÍÓû§¿Õ¼ä¡£Óû§¿Õ¼ä¼´Óû§Ó¦ÓÃËùÔËÐеĿռ䣬Äں˿ռäÖµµÃÊDzÙ×÷ϵͳÄÚºËÔËÐеĿռ䡣Óû§¿Õ¼ä²»ÄÜÖ±½ÓÒýÓûòÕß²Ù×÷Äں˿ռäµÄÊý¾Ý£¬Äں˿ռäÒ²²»ÄÜÖ±½ ......
LinuxÄÚºËÅäÖð취£º
1. make config
ÕâÖÖ°ì·¨»á±éÀúËùÓÐÅäÖÃÏҪÇóÓû§Öð¸öÑ¡ÔñY/N/M
2. make menuconfig
Õâ¸ö°ì·¨ÊÇ»ùÓÚncurse¿â±àÖƵÄͼÐνçÃ湤¾ß¡£³£ÓÃ
3. make xconfig
ÓÃÓÚ»ùÓÚX11µÄͼÐι¤¾ß
4. make gconfig
ÓÃÓÚ»ùÓÚgtk+ͼÐι¤¾ß
5. make defconfig
´´½¨Ò»¸öĬÈϵÄÅäÖã¬Éú³Éµ±Ç°µÄ.config
6. make x ......
/*
* ¸ÃÎļþʵÏÖϵͳµ÷ÓÃread£¬writeºÍlseek¡£
*/
/*
* linux/fs/read_write.c
*
* (C) 1991 Linus Torvalds
*/
#include <sys/stat.h>
#include <errno.h>
#include <sys/types.h>
#include <linux/kernel.h>
#include < ......
/*
* linux/fs/char_dev.c
*
* (C) 1991 Linus Torvalds
*/
#include <errno.h>
#include <sys/types.h> // ¶¨ÒåÁË»ù±¾µÄϵͳÊý¾ÝÀàÐÍ
#include <linux/sched.h>
#include <linux/kernel.h> // º¬ÓÐһЩÄں˳£Óú¯ÊýµÄÔÐζ¨Òå
#include < ......
תÔØ£ºhttp://www.cnblogs.com/hexapodsoft/archive/2007/04/24/724902.html
I/OÖض¨ÏòÏê½â¼°Ó¦ÓÃʵÀý
1¡¢ »ù±¾¸ÅÄÕâÊÇÀí½âºóÃæµÄ֪ʶµÄÇ°ÌᣬÇëÎñ±ØÀí½â£©
a¡¢ I/OÖض¨Ïòͨ³£Óë FDÓйأ¬shellµÄFDͨ³£Îª10¸ö£¬¼´ 0¡«9£»
b¡¢ ³£ÓÃFDÓÐ3¸ö£¬Îª0£¨stdin£¬±ê×¼ÊäÈ룩¡¢1£¨stdout£¬±ê×¼Êä³ö£©¡¢2£¨stderr£¬±ê×¼´íÎóÊä ......