- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- how to check the file size & FTP
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Discussions
Forums
Forums
Discussions
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
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- 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
тАО12-06-2001 08:04 AM
тАО12-06-2001 08:04 AM
2.how to check the file size more than 10 bytes
to use that condition in a shell script ?
3. how to chage the permission of FTP files ?
i have a user 'ftpguy' . when ever 'ftpguy' try to write
files(using ftp process) on hp9000(HP-UX 11.0), the permission on the
created files always show as 'rw--r----' .
how to chage those permissions('rw-rw-rw') with in ftp script ?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-06-2001 08:08 AM
тАО12-06-2001 08:08 AM
Solution# touch filename
2.how to check the file size more than 10 bytes
to use that condition in a shell script ?
SIZE=`ll filename | awk '{print $5}'`
if [ $RMSIZE -gt 0 ]
then
echo "Size is bigger that 0"
else
echo "Size is 0"
fi
3. how to chage the permission of FTP files ?
i have a user 'ftpguy' . when ever 'ftpguy' try to write
files(using ftp process) on hp9000(HP-UX 11.0), the permission on the
created files always show as 'rw--r----' .
how to chage those permissions('rw-rw-rw') with in ftp script ?
Use chmod option within ftp. You can read the man page to get all the info you want.
Good Luck,
C
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-06-2001 08:16 AM
тАО12-06-2001 08:16 AM
Re: how to check the file size & FTP
You can create a 0 byte file by using touch command. touch filename
To find the file larger file
find /dir -size +10c -exec ls -l {} \;
where dir is the directory name. You can increase the number of zeroes infrint of 10 to llok for bigger files.
use chmod to change the permissions, you can use it within ftp itself or you can do it after ftp.
Goodluck,
-USA..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-06-2001 08:18 AM
тАО12-06-2001 08:18 AM
Re: how to check the file size & FTP
eg :
Change this line in /etc/inetd.conf from:
ftp stream tcp nowait root /etc/ftpd ftpd -l
to:
ftp stream tcp nowait root /etc/ftpd ftpd -l -u000
Files created by ftpd will have permissions of rw-rw-rw- unless there is a umask to alter the permissions.
By default the umask is 027 which
gives default permissions for files created by ftp as rw-r-----.
To re-read inetd.conf
# inetd -k => kill
# inetd => start it
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-06-2001 08:21 AM
тАО12-06-2001 08:21 AM
Re: how to check the file size & FTP
A very easy way to create a 0 length file is to use "cp /dev/null myfile".
The others have given you ways to determine file size.
You can also use the perl stat() function to get anything you want to know about a given file.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-06-2001 08:29 AM
тАО12-06-2001 08:29 AM
Re: how to check the file size & FTP
if [ $RMSIZE -gt 0 ] should be
if [ $SIZE -gt 0 ]
Good thing I always double check my posts.
Sorry.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-06-2001 08:34 AM
тАО12-06-2001 08:34 AM
Re: how to check the file size & FTP
for question 1
# touch file_name
for option 2
SIZE=`ll filename | awk '{print $5}'`
if [ $SIZE -gt 10 ]
then
echo "Size is bigger that 0"
else
echo "Size is less than 10"
fi
For option 3,
use mask when ftp'ing the file, Here is a link on how to do that,
http://us-support2.external.hp.com/cki/bin/doc.pl/sid=91ec961512e2df8064/screen=ckiDisplayDocument?docId=200000051808646
Hope this helps.
Regds
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-06-2001 08:45 AM
тАО12-06-2001 08:45 AM
Re: how to check the file size & FTP
Use touch command to create a zero byte file.
Also "> file name" will create a null byte file.
For file permissions for ftp user either set the umask to 111 or use chmod command in ftp script.
Thanks.
Prashant.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-06-2001 08:45 AM
тАО12-06-2001 08:45 AM
Re: how to check the file size & FTP
thnx all of you.
for my 3rd questions
i want to use chmod in FTP script.
here is my commands.
here i am using hp-ux ftp from hp3000 m/c.
it looks like chmod not a valid command in ftp.
or i am not using right syntax?
ftp
----
Name(manager): ftpuser
331 Password required for ftpuser.
Password:
230 User ftpuser logged in.
Remote system type is UNIX.
ftp> cd /u03/hp3000files/dc
250 CWD command successful.
ftp> put ACT052OZ.DATA zones.data
200 PORT command successful.
150 Opening ASCII mode data connection for zones.data.
226 Transfer complete.
2050 bytes sent in 0.00 seconds (400.39 Kbytes/sec)
ftp> chmod 777 zones.data
?Invalid command. (FTPERR 6)
ftp>
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-07-2001 10:18 AM
тАО12-07-2001 10:18 AM
Re: how to check the file size & FTP
(i.e. "ftp") is a non-standard extension. It only works
if the FTP server understands the "SITE CHMOD"
command. The HP-UX FTP server (i.e. "ftpd")
does understand it, so that's why "chmod" in FTP
works when the client and the server are both
HP-UX. See the man pages for "ftp" and "ftpd"
for more info.
To see if the server supports "SITE CHMOD",
log into it with ftp, then type the command "site help"
at the ftp prompt and see what it says.
HTH
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-10-2001 02:03 AM
тАО12-10-2001 02:03 AM
Re: how to check the file size & FTP
1. Creating empty file ( size zero ) :
# touch emtyFile.log
2. Testing size if equal to 0 ( zero ) in a script :
if [[ `ls -l emptyFile.log ?? awk '{print $5}'` = 0 ]] then
echo "### emptyFile.log file size is ZERO ..."
else
echo "### emptyFile.log file size is NOT ZERO ..."
fi
3. Permission on file while ftp; You may set the umask ( File creation mask )value to allow that.
The following value 000 will give rwxrwxrwx for all files that will be created after.
# umask 000
The following value 111 will give r-xr-xr-x for all files that will be created after.
# umask 111
For some specific creation permissions, you may need to apply the following formula :
Needed permission = 666 - Mask-Value
Magdi