Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Script to collect log files in case of server crash Post 302849053 by MadeInGermany on Friday 30th of August 2013 06:24:26 PM
Old 08-30-2013
I would improve
Code:
cd /exports

by
Code:
cd "$dstdir" &&

I.e. the following command is only run if the cd was successful.

Further I am not used to the construct in your for loop, and would use simple shell code instead:
Code:
( # do the cd in a sub shell
if cd "$srcdir"
then
 for srcfile in *
  do
    [ -f "$srcfile" ] &&
    cp "$srcfile" "$dstdir/$srcfile.$d"
  done
fi
) # return from the sub shell = recover from the cd

At least have each $variable in quotes when used in command arguments!
--
If you need additional debugging tools, like tusc/truss and tcpdump:
simply download them from hpux.connect.org.uk. Do not forget to also download the run-time-dependent packages (e.g. libpcap and openssl are required by tcpdump).
 

9 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

linux server crash

Hi I faced a problem while booting linux which is as follows;- ************************************************* Inode 146180 has illegal block(s) xauth:error in locking authority file /home/root/.Xauthority Fatal Server Error: Could not create lock file in /tmp/tXo-lock ... (1 Reply)
Discussion started by: Abhishek
1 Replies

2. UNIX for Dummies Questions & Answers

server crash

Our SUn Solaris Server has crashed second time in 2 days, reason is not known , we are trying to determine what could have gone wrong, any ideas, the power supply seems to be fine, there is no response from keyboard,monitor etc and we had to do a hot boot yesterday.. Any suggestions what could be... (9 Replies)
Discussion started by: knarayan
9 Replies

3. UNIX for Advanced & Expert Users

Solaris Server Crash

We have had a server (Solaris 2.6) hardisk crash. When booting the server we get: ok> boot -S Boot Device: /sbus/espdmc@e, 8400000/esp@e,8800000/sd@0,0 short read 0x2000 chars read disk read error The only way we can get into the console is to ok> boot cdrom whereby everything (e.g.... (3 Replies)
Discussion started by: Breen
3 Replies

4. Shell Programming and Scripting

How to collect all the list of files along with the permissions

Hi guys, I have one problem. I need collect the list files along with the file permissions in all directories in one server. Is their any easy way to collect using any commands or any scripts? Advance Thanks :) (2 Replies)
Discussion started by: kartheek
2 Replies

5. SCO

Crash error on my unix server

Hi there. Well i have a really bad problem with my server: UnixWare Version 5 Release 7 The system crash :wall: and show the error: Panic: Kernel-mode address fault on user address 0x00000004 :eek: If anyone knows about the reason of this error please give me a help Sorry by my english.... (3 Replies)
Discussion started by: danilosevilla
3 Replies

6. UNIX Desktop Questions & Answers

collect data from files

there are 200 files named file1_0.pdb,file1_60.pdb etc....it looks like: ATOM 1 N VAL 1 8.897 -21.545 -7.276 1.00 0.00 ATOM 2 H1 VAL 1 9.692 -22.015 -6.868 1.00 0.00 ATOM 3 H2 VAL 1 9.228 -20.766 -7.827 1.00 0.00 ATOM 4 H3 ... (5 Replies)
Discussion started by: kanikasharma
5 Replies

7. UNIX for Advanced & Expert Users

Collect files from different servers to a single server and append them

Hi, I have script1.sh on 3 servers. I want to collect output report generated by them to a single server and append all the reports. Please tell me how can i do this? (2 Replies)
Discussion started by: pratikm23
2 Replies

8. Shell Programming and Scripting

Case script to get missing sequence among files

I want to use case statement to find the range of missing sequence in my directory which it has some few ( dat & DAT ) files my directory /home/arm/my_folder/20130428 contains : f01_201304280000.DAT f01_201304280001.DAT f01_201304280003.DAT f02_201304280000.dat f02_201304280002.dat... (2 Replies)
Discussion started by: arm
2 Replies

9. Shell Programming and Scripting

Collect files for specific hours

I have to fetch files from a location hour wise. Eg files available at location /tmp/data/ are A20140205.1300-1315...... . . A20140205.1400-1415...... . . A20140205.1700-1715...... . . . . Below is the code I have prepared. But it works only for one hour. For instance... (1 Reply)
Discussion started by: Saidul
1 Replies
NDB_PRINT_BACKUP_(1)					       MySQL Database System					      NDB_PRINT_BACKUP_(1)

NAME
ndb_print_backup_file - print NDB backup file contents SYNOPSIS
ndb_print_backup_file file_name DESCRIPTION
ndb_print_backup_file obtains diagnostic information from a cluster backup file. Usage ndb_print_backup_file file_name file_name is the name of a cluster backup file. This can be any of the files (.Data, .ctl, or .log file) found in a cluster backup directory. These files are found in the data node's backup directory under the subdirectory BACKUP-#, where # is the sequence number for the backup. For more information about cluster backup files and their contents, see Section 17.5.3.1, "MySQL Cluster Backup Concepts". Like ndb_print_schema_file and ndb_print_sys_file (and unlike most of the other NDB utilities that are intended to be run on a management server host or to connect to a management server) ndb_print_backup_file must be run on a cluster data node, since it accesses the data node file system directly. Because it does not make use of the management server, this utility can be used when the management server is not running, and even when the cluster has been completely shut down. Additional Options None. COPYRIGHT
Copyright (C) 1997, 2014, Oracle and/or its affiliates. All rights reserved. This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. This documentation is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with the program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA or see http://www.gnu.org/licenses/. SEE ALSO
For more information, please refer to the MySQL Reference Manual, which may already be installed locally and which is also available online at http://dev.mysql.com/doc/. AUTHOR
Oracle Corporation (http://dev.mysql.com/). MySQL 5.5 01/30/2014 NDB_PRINT_BACKUP_(1)
All times are GMT -4. The time now is 01:09 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy