العودة   منتديات داماس > انظمة التشغيل والاوفيس > الأنظمة المفتوحة المصدر Open Source OS


06-07-2010, 03:33 AM
مستخدم00 غير متصل
عضو جديد
رقم العضوية: 340176
تاريخ التسجيل: Jul 2010
المشاركات: 1
دُعي الى: 0 موضوع
 


أخوتي الأعزاء ..

أتمنى من الله ثم منكم المساعدة العاجلة في جزئية من الحل .. مع العلم أنني حاولت ولكن لم أستطع أن أنجح في حل هذه المشكلة على الرغم من إنتهائي من جميع الأوامر السابقة.


المشكلة في عمل الريستور. سوف أقوم بكتابة السؤال ووضع الحلول كاملة .. وأتمنى منكم المساعدة في حل الريستور على وجه الخصوص وكذلك إبداء الملاحظات على بقية الحلول في حالة وجود أي خطأز

مع العلم أنني قمت بتنفيذ جميع الأوامر وقد نجحت بإستثناء الريستور.


السؤال :


BackUp system coursework

You are employed by the MUU Expert Software Systems Company as a Unix specialist. You are point to provide a simple set of scripts for a customer who requires a system to enable the backing up of files and Directories. The scripts should be (these names should be used - you will lose marks if other names are used!)



·initialise – initialises the Directory for the BackUp (called BackUp and be in your home Directory) and any associated files, and should be run once before using the other scripts
  • delete– deletes a file/Directory from given location.
·restore – list files/Directories in BackUp system and restores selected files and/Directories



For example, typing restore without a file/Directory name list the content:
mc09xx:0:/home/msc10xx/msccw/results
mc09xx:1:/home/msc10xx/msccw/delly
mc09xx:2:/home/msc10xx/msccw/tmp



You can then type restore 1 to restore the file delly. Note if you BackUp two files with the same name, they should both be saved and you should be able to restore either or both of them.
  • empty will just empty the trash can.
initialise just sets up any Directories, files etc that the system needs and should be run once before using the other scripts.



You may assume that the user has a bin Directory which is on their PATH
You should make the scripts as robust as possible since they will be used by ex-Windows users. They should be Designed to operate from a Directory on the users path (e.g. $HOME/bin)


الحلول :

# Script copies all files under the given path $1

#
also it writes down the original path for all the backed up files so that it can be restored later.

# the file EXT.DAT contains the original path & file's number.



mkdir ~/BackUp # create the BackUp folder



# check if the prv. step done or not:

if [ $? = 0




]

then

echo A new folder called BackUp has been created in Home
else
echo The folder already exists
fi





# remove the previous data file that contains the original paths for prev. files.

# this step is important since this script should create a new file whenever it has been run.
rm ~/BackUp/EXT.DAT





echo Copying all files in $1



# initi. counter

c=1
for f in `ls -l $1 -- grep ^- -- awk '{ print $8 }'` # take all files under $1 Directory
do
cp $f ~/BackUp # copy the file to BackUp folder
echo [$c]$f copied # give info for user about it





echo [$c]$1$f >> ~/BackUp/EXT.DAT # write the file's original path to EXT.DAT file with a sequnce number




c=$(($c + 1)) # increment the counter


.


done

echo `ls -l $1 -- grep ^- -- wc -l` files have been copied to ~/BackUp sccUSSFully. # give info for user about the process




.



========================



# delete files/Directorys

# $1 contains the path of the file/Directory to be deleted.





# check if the user gave a parameter or not:

if [ $# = 0





]

then

echo Error, you have to give one parameter, either file/Directory to delete




.

echo E.g.: ./delete.sh ~/Desktop/testfoler

else





# check if the file/directroy exsits or not

if [ -d $1 ] ---- [ -f $1




]

then

echo Do you really want to delete $1 [Y or N




]?

read answer

if [ $answer = "y




" ]

then

mv $HOME/BackUp/ #rm -rf $1

echo $1 has neen deleted




.

else

echo Nothing done




.

fi # end inner if

else
echo $1 does not exsits
fi # end outter if





fi




=====================



# This script empty the trash can, where the trash path is "~/.local/share/Trash/files/*" (Ubuntu 9.10)

# Also, the Trash a Hidden folder because there is a dot before the name of the folder.





#get number of files in Trash:

n=`ls -l $HOME/BackUp -- head -n 1 -- awk '{print $2




}'`


# confirm deleteion:

echo Do you want to delete $n files/Directorys from Trash [Y or N




]?

read answer



if [ $answer = "Y


" ]

then # start deleteing


:

rm -rf $HOME/BackUp


/*

echo $n files/Directorys have been deleted from Trash


.

else

echo Nothing done




.

fi # end if



=================



#check if there is parameters or not

if [ $# = 0




]

then

echo List of all files in BackUp system




:

# cat ~/BackUp/EXT.DAT



cd ~/BackUp



for f in `ls -l -- grep ^- $1 -- awk '{ print $8 }'` # take all files under $1 Directory

do





echo [$c]$f





c=$(($c + 1)) # increment the counter


.


done



elif [ `sed -n "/^\[$1\]/s/.*]//p" ~/BackUp/EXT.DAT` = 0


]


# Store the file's original path into variable p

p=$( sed -n "/^\[$1\]/s/.*]//p" ~/BackUp/EXT.DAT




)


# Take the name of the file and store it into variable f:

f=$( echo $p -- awk 'BEGIN { FS = "\/"} ;{ print $NF




}' )


# add the abso. path to ff:

ff=~/BackUp/$f





# copy ff to the original path p:

cp $ff $p
echo File $f restored sucCSSfully to its original location $p





else



mv $1 ~/$1



fi



==================



المشكلة في السكربت الأخير لا يعمل. تظهر نافذة تفيد بوجود خطأ في السطور الأخيرة.




أتمنى من الله ثم منكم المساعدة في تعديل الحل. حيث أن العمل لابد أن يتم تسليمه يوم الإثنين القادم إن شاء الله وأنا في مشكلة مع النقطة الأخيرة.







مع الشكر لكم جميعا





المواضيع المتشابهه
الموضوع كاتب الموضوع المنتدى مشاركات آخر مشاركة
مشكلة فى عمل برنامج بالفيجوال بيسك(كود واحد يوجد به مشكلة)ارجووا المساعدة love whisper007 البرمجة القياسية Ajax - XML - CSS - JavaScript -php وغيرهم 2 02-04-2009 06:39 PM
مشكلة : أواجه مشكلة فى الويندوز الخاص بى Black Heart kingo_2003 المنتدى العام لتصميم الأسطوانة 2 02-03-2008 06:46 PM
بصورة حل مشكلة صادف iexplore.exe مشكلة ويجب إغلاقه. المعذرة على الإزعاج ][ ثبت ][ احمد ابوزيد صيانة الكمبيوتر وحلول الحاسب الألي - هاردوير 6 19-12-2007 01:12 PM
مشكلة والله مشكلة mp4 لا أعرف كيف أدخل إليها الفيديوات saidsoft.zmaim برامج الفيديو, خلفيات فيديو, برامج الصوتيات 3 08-12-2007 09:00 PM
مشكلة في تسجيل الدخول بماسينجر الهوتميل + مشكلة بالدخول للبريد مخلب النمر صيانة الكمبيوتر وحلول الحاسب الألي - هاردوير 1 16-01-2005 11:25 PM

28-07-2010, 10:16 AM
اذكرالله غير متصل
مشرف سابق
رقم العضوية: 327106
تاريخ التسجيل: Mar 2010
الإقامة: japan - italy
المشاركات: 2,049
دُعي الى: 2 موضوع
 
الصورة الرمزية اذكرالله
وعليكم السلام

. تظهر نافذة تفيد بوجود خطأ في السطور الأخيرة.
هل تضع صورة لها ؟؟


وايضا هناك تطبيق خاص يتيح لك عمل BackUp و restore .
اما اذا اردتها لغرض التطوير فتواصل معي لكي نطور ال code خاصتك

وشكرا




التوقيع:
انا لست عربي
لذا اعذرني اذا لم افهمك من البداية
شاركنا بتصميم سطح مكتبك


++ Off-Line ++

 

أدوات الموضوع

أقسام منتديات داماس
بوابة داماس
منتدى الحوار
اخبار عربية
ثقافة عامة
المنتدى الاسلامي
منتدى الشعر
استشارات قانونية
استشارات طبية
فن الطبخ
حلويات عربية
أفلام وثائقية
انمي مترجم
طرائف والغاز
افلام يوتيوب
الرياضة العربية
عالم السيارات
اخر الاخبار
الارشيف
اعلانات تجارية
مفروشات
استضافة مواقع
توصيات فوركس
التجارة الالكترونية
كاميرات مراقبة
شركات صيانة
وظائف شاغرة
معاهد وجامعات
عقارات للبيع
سياحة وسفر
شاحنات وسيارات
كسارات ومكائن
برامج
برامج الحماية
برامج البورتابل
برامج الماكنتوش
برامج اللينكس
برامج الفيديو
برامج الهندسة
دروس هندسية
شرح البرامج
برامج التورنت
دعوات تورنت
برامج الجوال
برامج اندرويد
مخططات صيانة الجوال
العاب
العاب بلاي ستيشن
خلفيات فوتوشوب
دروس فوتوشوب
فرش فوتوشوب
فن التصوير
خطوط
تصاميم جاهزة
صيانة الكمبيوتر
صيانة الماذر بورد
تعليم الشبكات
شهادات مايكروسوفت
دروس برمجة
برامج مدرسية
كتب
تطوير المواقع
تصميم الويندوز
نسخة مصدرية
العمليات التجميلية
اضافة البرامج
مالتي بوت
ويندوز التيمت
تصاميم فوتوشوب
خلفيات للفوتوشوب
مركز تحميل فيديو
تحميل صور
العاب فلاش
الابراج
دليل مواقع
Seo tools
Biology
Flash Games
htaccess online
Pagerank Checker
فحص البيج رانك
تحويل التاريخ
تحويل العملات
rss  rss 2.0  Html   xml  sitemap 


Powered by vBulletin® Version
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
The owner and operator of the site is not responsible for the availability of, or any content provided.
Topics that are written in the site reflect the opinion of the author.
جميع ما يُطرح من مواضيع ومشاركات تعبر عن رأي كاتبها ولا تعبر عن رأي مالك الموقع أو الإدارة بأي حال من الأحوال.