LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 06-20-2011, 09:53 AM   #1
praveenhari
LQ Newbie
 
Registered: Jan 2011
Posts: 4

Rep: Reputation: 0
Script to check mounting device


Hi,
I have written a script to take backup of my database in remote server which is a windows machine.i have mounted that machine to my server using the script and daily script will run automatically, i have scheduled it using crontab like that and backup will be taken. but if my remote server is down means it gets unmounted and my backup falls on my local linux server itself.
i want a script to check whether the remote server is mounted or not if mounted take the backup or else stop the backup. I am very new to scripting so plz help me out in simple way. send me the script
 
Old 06-20-2011, 10:19 AM   #2
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,634

Rep: Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965
Quote:
Originally Posted by praveenhari View Post
Hi,
I have written a script to take backup of my database in remote server which is a windows machine.i have mounted that machine to my server using the script and daily script will run automatically, i have scheduled it using crontab like that and backup will be taken. but if my remote server is down means it gets unmounted and my backup falls on my local linux server itself.
i want a script to check whether the remote server is mounted or not if mounted take the backup or else stop the backup. I am very new to scripting so plz help me out in simple way. send me the script
No, we're not going to "send you the script", and spell out your words.

If you have already WRITTEN the script, that implies that you're familiar with shell scripting. Why don't you post what you've written already? And have you checked Google for any of the THOUSANDS of shell-scripting tutorials? Or bothered to search here, since it's been answered before???
http://www.linuxquestions.org/questi...script-392668/
http://www.linuxquestions.org/questi...script-606677/
http://www.linuxquestions.org/questi...-is-ok-520051/
 
Old 06-20-2011, 10:22 AM   #3
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Germany
Distribution: Whatever fits the task best
Posts: 17,148
Blog Entries: 2

Rep: Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886
Check the return code of the mount command. If it is not 0 the mount failed and you can abort the backup.
Quote:
send me the script
This is not the way it works on LQ. We will help you with your problems, but not do the work for you.
 
1 members found this post helpful.
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Mounting encrypted LVM - Device /dev/.../lv_home is not a valid LUKS device. recarv Linux - Hardware 3 02-15-2011 02:38 PM
How to check that my script can check if it has a specific range of charcters. shirlcurl20 Linux - Newbie 2 11-16-2010 11:15 PM
[SOLVED] Check if device is mounted in a bash script wael_h Slackware 5 08-01-2010 01:05 PM
trouble mounting my dvd-rw - can someone check my fstab? sasquatch Linux - Hardware 21 09-27-2004 06:50 AM
script check to see if device is mounted Warmduvet Programming 14 09-03-2004 06:17 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 06:35 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration