HPE GreenLake Administration
- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - Linux
- >
- Re: Question of syntax
Operating System - Linux
1827757
Members
2958
Online
109969
Solutions
Forums
Categories
Company
Local Language
back
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
back
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-06-2009 04:25 AM
05-06-2009 04:25 AM
Question of syntax
Hi there --
The code listed below is an excerpt from a script that I am writing. The goal is to verify that a directory on a remote server is available to the local system. If that is not the case, a log file is written, and all filesystems that were previous unmounted, are remounted on the local system.
###############################################
# Unmount all NFS mounts prior to the archive process.
umount -a -t nfs
# Mount the remote directory (NFS) prior to running the make_net_recovery script.
# Make sure there is a folder located in the /mnt directory. If it is
# not already there, create one.
mount:/ /mnt/
# Verify the remote directory (NFS) is available. This directory is needed
# as it is the destination for the iso images. If it is not available, stop
# here, and write the results to a log file.
df |grep > /dev/null
RC=$?
echo $RC
if [ ${RC} -eq 0 ]
then
echo successful
else
echo not successful >> /tmp/make_net_backup.log && mount -a
exit
fi
###############################################
Is the syntax shown above correct? Thanks.
The code listed below is an excerpt from a script that I am writing. The goal is to verify that a directory on a remote server is available to the local system. If that is not the case, a log file is written, and all filesystems that were previous unmounted, are remounted on the local system.
###############################################
# Unmount all NFS mounts prior to the archive process.
umount -a -t nfs
# Mount the remote directory (NFS) prior to running the make_net_recovery script.
# Make sure there is a
# not already there, create one.
mount
# Verify the remote directory (NFS) is available. This directory is needed
# as it is the destination for the iso images. If it is not available, stop
# here, and write the results to a log file.
df |grep
RC=$?
echo $RC
if [ ${RC} -eq 0 ]
then
echo successful
else
echo not successful >> /tmp/make_net_backup.log && mount -a
exit
fi
###############################################
Is the syntax shown above correct? Thanks.
A Journey In The Quest Of Knowledge
2 REPLIES 2
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-06-2009 05:24 AM
05-06-2009 05:24 AM
Re: Question of syntax
> Is the syntax shown above correct?
Why not run the script, and get the opinion
of the shell, which is the only opinion which
matters?
Why not run the script, and get the opinion
of the shell, which is the only opinion which
matters?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-09-2009 01:36 PM
05-09-2009 01:36 PM
Re: Question of syntax
>Is the syntax shown above correct?
A real shell has the "-n" option to check.
Some comments:
df | grep > /dev/null
You can remove the redirection with:
df | grep -q
echo not successful >> /tmp/make_net_backup.log && mount -a
Any reason you are using "&&" here? Why would an error in writing to your log keep you from trying to mount?
A real shell has the "-n" option to check.
Some comments:
df | grep
You can remove the redirection with:
df | grep -q
echo not successful >> /tmp/make_net_backup.log && mount -a
Any reason you are using "&&" here? Why would an error in writing to your log keep you from trying to mount?
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
Company
Support
Events and news
Customer resources
© Copyright 2025 Hewlett Packard Enterprise Development LP