LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 09-10-2019, 08:32 AM   #1
l0f4r0
Member
 
Registered: Jul 2018
Location: Paris
Distribution: Debian
Posts: 900

Rep: Reputation: 290Reputation: 290Reputation: 290
Question quotacheck & mail incompatibility


Hello,

Here is a mystery.
My script is the following:
Code:
#!/bin/bash
set -xv
quota_report=$(mktemp)
{ quotaoff -va && quotacheck -vafmn; quotaon -va; } &>$quota_report
mail -s "[QUOTA] [$(uname -n)] Mise à jour des quotas" "root@localhost" <"$quota_report"
echo "rc=$?"
Output seems ok, temporary file is created and its content is OK but NO email is sent (I have nothing in inbox, spam or any folder).
Quote:
Originally Posted by output
quota_report=$(mktemp)
++ mktemp
+ quota_report=/tmp/tmp.tmZYsMCkLp
echo "quota_report=$quota_report"
+ echo quota_report=/tmp/tmp.tmZYsMCkLp
quota_report=/tmp/tmp.tmZYsMCkLp
{ quotaoff -va && quotacheck -vafmn; quotaon -va; } &>$quota_report
mail -s "[QUOTA] [$(uname -n)] Mise à jour des quotas" "root@localhost" <"$quota_report"
++ uname -n
+ mail -s '[QUOTA] [MDSSRV001] Mise à jour des quotas' root@localhost
echo "rc=$?"
+ echo rc=0
rc=0
Quote:
Originally Posted by /tmp/tmp.tmZYsMCkLp
+ quotaoff -va
/dev/sda1 [/]: user quotas turned off
/dev/sda5 [/home]: user quotas turned off
+ quotacheck -vafmn
quotacheck: Scanning /dev/sda1 [/] quotacheck: Old group file name could not been determined. Usage will not be subtracted.
quotacheck: Checked 20766 directories and 217679 files
quotacheck: Scanning /dev/sda5 [/home] done
quotacheck: Old group file name could not been determined. Usage will not be subtracted.
quotacheck: Checked 488 directories and 1351 files
done
+ quotaon -va
/dev/sda1 [/]: user quotas turned on
/dev/sda5 [/home]: user quotas turned on
If I just modify:
Code:
{ quotaoff -va && quotacheck -vafmn; quotaon -va; } &>$quota_report
into:
Code:
{ quotaoff -va; quotaon -va; } &>$quota_report
Mail is sent as expected initially.
quotacheck seems to be problematic for mail...

Can somebody explain me this behavior please?
Thanks in advance

PS: how can I inspect mail logs with journalctl please? I'm using exim4

Last edited by l0f4r0; 09-10-2019 at 08:55 AM.
 
Old 09-12-2019, 01:59 AM   #2
MadeInGermany
Senior Member
 
Registered: Dec 2011
Location: Simplicity
Posts: 2,791

Rep: Reputation: 1201Reputation: 1201Reputation: 1201Reputation: 1201Reputation: 1201Reputation: 1201Reputation: 1201Reputation: 1201Reputation: 1201
One question:
what is the purpose of running quotacheck?
It is high stress for the disk.
 
Old 10-01-2019, 12:28 PM   #3
l0f4r0
Member
 
Registered: Jul 2018
Location: Paris
Distribution: Debian
Posts: 900

Original Poster
Rep: Reputation: 290Reputation: 290Reputation: 290
Ok, I've spotted the error thanks to switch -v added to command mail:
Code:
T=remote_smtp: message is too big (transport limit = 1)
Indeed, quotacheck is somewhat interactive as its output displays a kind of ASCII spinning wheel while user is waiting for it to check quotas. Thus each step of this spinning wheel is decomposed of non printable |/-\ characters (like sprites) in my $quota_report redirected output file and I end up with too long lines inside the file (when waiting time has been very long) to be sent by mail.

I know there is flag IGNORE_SMTP_LINE_LENGTH_LIMIT you can set to 1 in exim4 config files but I've simply switched to mutt instead of mail command in my script.
Problem resolved

Quote:
Originally Posted by MadeInGermany View Post
One question:
what is the purpose of running quotacheck?
It is high stress for the disk.
I want to verify there is no discrepancies with my samba shared quotas. Is it bad practice?

Last edited by l0f4r0; 10-01-2019 at 12:32 PM.
 
  


Reply

Tags
mail;



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
chkconfig & quotacheck slackware07 Fedora 0 05-15-2006 08:27 PM
Ph&#7909;c h&#7891;i d&#7919; li&#7879;u b&#7883; m&#7845;t???, c&#7913; pollsite General 1 06-27-2005 12:39 PM
quotacheck command not found richlawson Mandriva 1 11-30-2003 01:48 PM
Gotta love those &#1649;&#1649;&#1649;&#1649;&#1649;&#1649;&#1649;&# iLLuSionZ Linux - General 5 11-18-2003 07:14 AM
Quotacheck? mikeshn Linux - General 1 06-07-2003 01:41 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 09:18 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration