| | ![]() | | |||||||
| |
| |||||||
| ركن دروس ومشاكل الإستضافــــة شروحات ودروس وحلول مشاكل الاستضافات وتبادل الخبرات [ يمنع طرح طلبات الاستضافة هنا ] |
![]() |
| | أدوات الموضوع |
| |||
| السلام عليكم ورحمة الله وبركاته الكثير منا يعاني من مسألة الباك اب الخارجي ونعلم جميعاً مدى أهميته لشركات الإستضافة البعض منا يستخدم الباك اب الداخلي فقط , والبعض الآخر يستخدم الخارجي فقط حيث أن لوحة تحكم السي بنل تسمح بأحد الطريقتين فقط ف إذا كنا نستخدم الباك اب الداخلي ,, ومطنشين الخارجي ,, نضطر نعمل الباك اب الخارجي بشكل يدوي ,, والبعض منا مسوي لنفسه سكربت من تحت لتحت ومايحب يشارك فيه احد , اليوم حنفتح الملفات ونعرض المواضيع للجميع للفائدة إهداء لمنتديات لينوكس العربية . تشغيل السكربت الموضح كوده بالأسفل ألا وهو xBackup.sh آمن جداً , يمكنك تجربته فقط بدون تشغيل عملية الرفع وخلافه , حيث يمكنك تشغيله وقراءة الأسئلة والإجابة عنها خطوة بخطوة. ماذا يحتاج السكربت ليعمل؟ 1- لوحة تحكم سي بنل 2- مساحة في بارتشن ال home مساوية لمساحة الباك اب الداخلي لديك لمعرفة المساحة المستهلكة من بارتشن الباك اب لديك قم بتطبيق الأمر التالي: رمز Code: du -h /backup/cpbackup/daily --max-depth=0أو قم بتقديرها تقديراً ولمعرفة المساحة المتبقية لديك ,, طبق الأمر التالي رمز Code: df -h3- قم بتشغيل السكربت في خارج أوقات الباك اب الداخلي لديك لمنع حدوث لود لديك. طريقة عمل السكربت: 1- يسألك السكربت عن معلومات بسيطة ماهو عنوان سيرفر الإف تي بي الذي تريد رفع الملفات عليه ؟ ماهو اليوزر؟ ماهو الباسورد ؟ بإمكانك عدم الإجابة عليها وتركها فارغة إذا كنت تريد وضعها كل مرة (ننصح بهذه الطريقة من نواحي أمنية) بإمكانك وضع هذه البيانات بحيث في المستقبل , ضغطة زر واحدة تقوم بعمل باك اب خارجي لك , أو تركها فارغة بحيث يطلبك البرنامج اليوزر والباسورد كل مرة لعمل الباك اب الخارجي. 2-بعد هذا السؤال سيقوم السكربت بتركيب سكربت آخر مخصص لك على السيرفر , فيه بيانات الإف تي بي المعطاه سابقا 3-سيسألك السكربت , هل تريد رفع الباك اب الآن ؟ في حالة نعم: سيسألك مرة أخرى , هل تريد أن تقرأ نتائج العمليات stdout و stderror على الشاشة ؟ أو تريد أن يقوم السكربت بالعمل في ال Background ويقوم بإنشاء ملفات لوق ؟ في حالة لا: سيقوم السكربت بتقديم أمر على طبق من ذهب تقوم بإستخدامه في أي وقت تشاء رفع الباك اب الخارجي فيه. لتنزيل السكربت ومعرفة الأوامر المطلوبة إنزل لآخر الموضوع هذا كود السكربت للمطورين والمبرمجين , رمز Code: #!/bin/bash #?################################################ ######## # External Backup Script v 1.0 ! # ################################################## ######## # # # This Script works on cPanel servers . # # Runing this script for testing is safe . # # This Script will prompt you and create another script # # to maintain your needs . # # # # You can run this script every time you need to do an # # an external backup, or you can execute the generated # # Script instead . # # # # Scripted By Mo9a7i . # # email : livehostsupport@gmail.com # # Please report any errors or suggestions to Mo9a7i . # # # ################################################## ######?# ParDir=`pwd` RunFile="$ParDir/xBacker.sh" intro() { clear echo "" echo -e "\t############################################### ###################" echo -e "\t# Welcome \033[34m to xBackup v 1.0 \033[0mBy Mo9a7i (Systems Admin) #" echo -e "\t# Please note that this script will work only with systems that #" echo -e "\t# run cPanel. #" echo -e "\t# #" echo -e "\t#\t\t \033[31mRUN AT YOUR OWN RISK \033[0m #" echo -e "\t############################################### ###################" echo "" } getInfo() { echo -e "\033[34mNote that it is recommended that you leave these lines empty for security reasons" echo -e "You can fill them manually at another point\033[0m" echo "" echo -n "Please enter the external ftp server's address:" read ftp_server echo -n "Enter ftp username:" read ftp_user echo -n "Enter password:" read ftp_pass corInfo } corInfo() { echo -e "\a" echo -e "\033[31m#####################Please make sure of the information below!#####################\033[0m" echo echo -e "Address : \t\033[34m $ftp_server\033[0m" echo -e "Username :\t\033[34m $ftp_user\033[0m" echo -e "Password :\t\033[34m $ftp_pass\033[0m" checkInfo } checkInfo() { echo "Are these information correct? (yes/no)" read ynanswer if [ $ynanswer = "yes" ] then echo "Thanxk you" elif [ $ynanswer = "no" ] then echo "\aPlease Correct Them" getInfo elif [ -n $ynanswer ] then echo "\aPlease enter yes or no as an answer, case is sensitve" checkInfo fi } write2file() { echo "#!/bin/sh" > $RunFile echo "##########################################" >> $RunFile echo "# By: Mo9a7i (livehostsupport@gmail.com #" >> $RunFile echo "##########################################" >> $RunFile echo "" >> $RunFile echo "#Enter the directory name that script could create to store backups in before uploading" >> $RunFile echo "TempDir=$ParDir/exbackup" >> $RunFile echo "" >> $RunFile echo "temp=\"/tmp/\$(basename \$0).\$\$\" ; trap \"/bin/rm -f \$temp\" 0" >> $RunFile echo "remote=$ftp_server" >> $RunFile echo "ftpu=$ftp_user" >> $RunFile echo "ftpp=$ftp_pass" >> $RunFile echo "" >> $RunFile echo "if [ -z \$remote ] ; then" >> $RunFile echo "echo \"Enter Ftp server:\"" >> $RunFile echo "read remote" >> $RunFile echo "fi" >> $RunFile echo "if [ -z \$ftpu ] ; then" >> $RunFile echo "echo \"Enter Ftp username:\"" >> $RunFile echo "read ftpu" >> $RunFile echo "fi" >> $RunFile echo "if [ -z \$ftpp ] ; then" >> $RunFile echo "echo \"Enter Ftp password:\"" >> $RunFile echo "read ftpp" >> $RunFile echo "fi" >> $RunFile echo "" >> $RunFile echo "mkdir \$TempDir" >> $RunFile echo "cd \$TempDir;echo -n \"Now in: \";pwd" >> $RunFile echo "" >> $RunFile echo "echo \"Creating Users list\"" >> $RunFile echo "ls -1 /var/cpanel/users > tempusers.txt" >> $RunFile echo "tail -n +3 tempusers.txt >users.txt" >> $RunFile echo "rm -rf tempusers.txt" >> $RunFile echo "" >> $RunFile echo "for Users in \$(cat users.txt)" >> $RunFile echo "do" >> $RunFile echo " echo -e \"\033[34mBacking Up \$Users\033[0m\"" >> $RunFile echo " /scripts/pkgacct \$Users" >> $RunFile echo " ech -r \"\033[34mMoving cpmove-\$Users.tar.gz to \$TempDir\033[0m\"" >> $RunFile echo " mv /home/cpmove-\$Users.tar.gz \$TempDir" >> $RunFile echo " echo -e \"\033[34m...................Done\033[0m\"" >> $RunFile echo "done" >> $RunFile echo "" >> $RunFile echo "echo \"user \$ftpu \$ftpp\" > \$temp" >> $RunFile echo "echo \"lcd \$TempDir\" >> \$temp" >> $RunFile echo "for file in \`find . -name \"*.tar.gz\"\`" >> $RunFile echo "do" >> $RunFile echo "if [ -f \$file ] ; then" >> $RunFile echo " echo \"!echo \"Uploading \$file\"\" >> \$temp" >> $RunFile echo " echo \"put \$file \$file\" >> \$temp" >> $RunFile echo " echo \"!echo \".....Done\"\" >> \$temp" >> $RunFile echo "else" >> $RunFile echo " echo \"skipping \$file: not a file.\" >&2" >> $RunFile echo "fi" >> $RunFile echo "done" >> $RunFile echo "echo \"quit\" >> \$temp" >> $RunFile echo "" >> $RunFile echo "echo \"Script will start the FTP Session now\"" >> $RunFile echo "ftp -n -u -v \$remote < \$temp" >> $RunFile echo "echo \"Closed FTP Session\"" >> $RunFile echo "" >> $RunFile echo "rm -rf \$TempDir" >> $RunFile echo "exit 0" >> $RunFile } makeFile() { touch $RunFile if [ -f $RunFile ] then echo -n "File Exists!" write2file chmod 750 $RunFile echo " And been successfully written to" else echo "File does not exist" exit 0 fi } eXec() { echo -e "Do you want to execute the file now? (yes-no)" read ysno if [ $ysno = "yes" ] then echo -e "Do you want to read the output? (yes-no)" echo -e "write (no) to let the program run in the Background and create log files" read noys if [ $noys = "yes" ] then sh $RunFile elif [ $noys = "no" ] then sh $RunFile > $ParDir/normal.log 2> $ParDir/error.log & else sh $RunFile fi elif [ $ysno = "no" ] then echo "To manually execute the script and upload your files you can run the command \"sh $RunFile\"" else echo "Please chose a correct answer (yes/no)" eXec fi } intro getInfo makeFile eXec echo "Have A Nice Day!" للتنزيل والتشغيل طبق الأوامر التالية أول بأول في الشل: رمز Code: wget http://www.hardlayers.com/download/xBackup.sh chmod 750 xBackup.sh لتشغيل البرنامج وقت ماتشاء , إذهب للمسار الذي قمت بتنزيل السكربت فيه وقم بتشغيله بالأمر التالي: رمز Code: ./xBackup.sh أرحب بإستفساراتكم وإقتراحاتكم وتعديلاتكم وكل حاجة بهالموضوع وننصح بتجربة البرنامج للمبتدئين بعد قراءة رأي الخبراء والمطورين تحياتي |
| |||
| ألف شكر يعطيك العافيه ما قصرت يعلني افداك
__________________ شبكة نحن العرب http://www.we3rb.com |
![]() |
| مواقع النشر (المفضلة) |
| أدوات الموضوع | |
| |
| |
إعلانات نصيه :
نحن العرب |
ألعاب |
اكس شير لتحميل الملفات |
دليل المواقع |
أخبار |
برامج الرئيسية | الاستضافة | الرسيلرات | السيرفرات | التصميم | الخدمات | اتفاقية الاستخدام | مركز سيرف نت Hosting, design, servers, management servers, development sites, the development of forums. Copyright © 2010 ServNt.Com All rights reserved. | |