I am trying to write a script which will check if the filesize is grather than 0 KB, compress the file and send to the email list else if the file size is zero KB don't send a mail update the log
When I am executing the script I am getting the below error
Please let me know where I am doing it wrong.
And if we compress the file and email, can we extract in windows using the normal winzip software?
Thanks and Regards,
Mora
The file size in ls -l output is field 5; not field 1. Try: if [ `ls -l /tmp/file.txt | awk '{print $5}'` -eq 0 ]
but as RavinderSingh13 suggested (but I think he reversed the desired outcome), a much more efficient test is:
Last edited by Don Cragun; 12-02-2014 at 04:17 AM..
Reason: Add more efficient test.
How can I perform size check of any character file(which switch)?
For example: I have to perform certain actions if file size is not zero. How can I do that?
Is this syntax fine?
if test ! -z $filename
then
fi (2 Replies)
Hi Friends,
i am trying to write a shell script which will check for the logfile size.
if the content of the logfile is wc -l >=1 then send mail with log file as attachment.else do nothing.
i'm trying the below code can any one help on this
if ]
then
(echo "`cat... (2 Replies)
Hi All,
I am in small problem..
i have one script which transfers some big files to my ftp usign normal command like put ....
my problem is how to check whether my file have been transferred successfully on ftp or not...
i know only inside ftp we have option like 'size' command which... (2 Replies)
I have following script on AIX/KSH
if ] ; then
echo "filename exists and is > 0 bytes"
else
echo "filename does not exist or is zero length"
fi
It is not working. What is wrong here??? (3 Replies)
I want to write a batch job (ksh) with the following requirement
we have file feeds coming to our system from other team,
if the file size is greater than expected then we dont need to process the file for the day
and need to archive the file and send email notification to the manager saying... (5 Replies)
if ; then
cp /tmp/testfolder/*.* ~/new/logs/
else
echo "No files today"
exit
fi
The problem is this doen't work when there is more than 1 file. Please tell me how to
take the latest file and check the size of the file in a directory (1 Reply)
I have been a long time lurker, and have learned a lot from these forums, thank you to everyone.
I am using Zoneminder to record a security camera feed. No motion detection, just 24 hour recording. I then have a script that checks Mysql for events dated the day before, and throws them at... (4 Replies)
I am trying to check whether two files are empty or not using below if condition but its checking for only one file
if ]
Again I tried
if && ]
Need your assistance (2 Replies)
Discussion started by: Aditya_001
2 Replies
LEARN ABOUT DEBIAN
mlmmj-unsub
mlmmj-unsub(1) General Commands Manual mlmmj-unsub(1)NAME
mlmmj-unsub - unsubscribe address from a mailinglist run by mlmmj
SYNOPSIS
mlmmj-unsub -L /path/to/list -a john@doe.org [-b] [-c | -C] [-d | -n | -N] [-h] [-q] [-r | -R] [-s] [-U] [-V]
-a: Email address to unsubscribe
-b: Behave as if unsubscription is due to bouncing (internal use)
-c: Send goodbye mail
-C: Request mail confirmation
-d: Unsubscribe from the digest version of the list
-h: This help
-L: Full path to list directory
-n: Unsubscribe from the nomail version of the list
-N: Unsubscribe from the normal version of the list
-q: Be quiet (don't notify owner about the unsubscribe)
-r: Behave as if request arrived via email (internal use)
-R: Behave as if confirmation arrived via email (internal use)
-s: Don't send a mail to the address if not subscribed
-U: Don't switch to the user id of the listdir owner
-V: Print version
DESCRIPTION
This utility is used to unsubscribe people from the specified mailinglist. It will remove the specified email address from every file in
the <listdir>/subscribers.d/, <listdir>/digesters.d/ and <listdir>/nomailsubs.d/ directories (or if the -d, -n or -N switch is given, only
the one relevant directory).
Unless the -U switch is used it will switch its user id to the user id owning the list directory. This is done to make sure that new files
created are having correct permissions.
Normally a mail is sent to the person being unsubscribed if the address is not subscribed to the list. If the -s switch is used such a mail
will not be sent.
When neither -c nor -C is specified, unsubscription happens silently from the point of view of the subscriber. When -q is specified, unsub-
scription happens silently from the point of view of the list owner. Use of -s is recommended to ensure you don't spam unsubscribed
addresses by accident.
SEE ALSO mlmmj-sub(1)AUTHORS
This manual page was written by the following persons:
Soren Boll Overgaard <boll@debian.org> (based on html2man output)
Mads Martin Jorgensen <mmj@mmj.dk>
mlmmj-unsub September 2004 mlmmj-unsub(1)