Validating files using server name and directory


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Validating files using server name and directory
# 1  
Old 07-15-2014
Reference Validating files using server name and directory

Hi,

I want to check if a file is a regular file or not using server name and file path.

Example: I want to check whether //<server_name>/home/chandan/abc.txt is a regular file or not.

Need your help!!.

Thanks
# 2  
Old 07-15-2014
What OS are you using?
What shell are you using?
# 3  
Old 07-15-2014
OS: Linux version 2.6.18-128.el5
Shell: bash shell

Thanks.
# 4  
Old 07-15-2014
Please use code tags as required by forum rules!

You have to login to the remote server, e.g. using ssh server, and there you can use the bash test for conditional expression, e.g [ -f /home/chandan/abc.txt ]
This User Gave Thanks to RudiC For This Post:
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How can I check, if on remote server directory is empty or have files?

I have a script, which is supposed to run 1 day of the month, connect to remote server certain directory, find files, tar the, and copy find . -ctime -1 | tar -cvf transfer_dmz_start_monthly.tar *${Today}*.*; if then echo "Cannot create a tar file, the terminated... (2 Replies)
Discussion started by: digioleg54
2 Replies

2. Shell Programming and Scripting

Directory containing files,Print names of the files in the directory that are exactly same content.

Given a directory containing say a few thousand files, please output a list of all the names of the files in the directory that are exactly the same, i.e. have the same contents. func(a_directory_name) output -> {“matches”: , ... ]} e.g. func(“/home/my/files”) where the directory... (7 Replies)
Discussion started by: anuragpgtgerman
7 Replies

3. AIX

How to backup a directory (sub-directories/files) files from one server on to other ?

Hello, Server A: /directory1/ Server B: /Backups/ i wanted to backup contents of /directory1 from "server A" on to "Server B" every 1 hour. If there is any change in (only new/differences) contents on serverA (directory1/) supposed to be backeup on next run. I did used rsync command to... (5 Replies)
Discussion started by: System Admin 77
5 Replies

4. Shell Programming and Scripting

Shell script to find the GB files in /tmp directory in remote server

Hi, i need help on shell scripting. Main intention of the script is step 1: ssh to remote server Step 2: cd /tmp in remote server Step 3: in tmp i want to grep only files and directories which are in GB sizes All the servers list file is - tmpsrv.txt vi tmpsrv.txt ... (17 Replies)
Discussion started by: kumar85shiv
17 Replies

5. Shell Programming and Scripting

Changing ownership of a directory, subdirectory and files as same as in another server

accidentally i have changed ownership of a directory,subdirectory and files wil below command. I want to the change ownership back as same as in same directory on another server. How can i do it? chown -R user:group /u01 is there any simple script? it is really an urgent need.. (2 Replies)
Discussion started by: johnveslin
2 Replies

6. Shell Programming and Scripting

Need some help on scripting for validating the files before loading

Hi, I need to perform some validation steps on the files before I start loading them. 1. I need to check for the availabilty of the file in expected path with expected name. 2. I need to check If the file format is correct. a. confirm if correct delimiter is used. b.... (1 Reply)
Discussion started by: smileyreddy
1 Replies

7. Shell Programming and Scripting

FTP files from different directory from remote server to one directory in local

Hi All, I want to search for .log files from folders and sub folders in remote server and FTP them to one particular folder in the local machine. I dont want to copy the entire directory tree structure, just have to take all the .log files from all the folders by doing a recursive search from the... (3 Replies)
Discussion started by: dassv
3 Replies

8. Shell Programming and Scripting

Validating the size of file transferred from ftp server to the local system

Validating the size of file transferred from ftp server to the local system. File type: Text file/Flat file Source System: Windows / Unix Systems Target System is always: Unix Mode of Transfer : ASCII We have generic ftp shell script that transfers the files from different ftp servers. ... (2 Replies)
Discussion started by: jpundalik
2 Replies

9. Shell Programming and Scripting

validating a file or directory

Hi there, im writing a script and trying the get the 2nd parameter and check it if its valid file or valid directory, Example: ./test -a quiz1 i need to check quiz1 ($2) if it matches any name of a file or directory. Thanks (3 Replies)
Discussion started by: new2Linux
3 Replies

10. UNIX for Advanced & Expert Users

Help me in receiving,validating emails and save them in local directory

hi, I'm working on a project where I get mails from different customers, what I need to do is I need to check if it is genuine mail and if there is any attachment I need to validate them and extract the message and save in the local directory as a text file say and then I need to direct it to... (4 Replies)
Discussion started by: sudharsanc
4 Replies
Login or Register to Ask a Question