Groups | Search | Server Info | Login | Register


Groups > alt.os.linux.mint > #47317

Re: echo does not display from bash script

From "Alan K." <alan@invalid.com>
Newsgroups alt.os.linux.mint
Subject Re: echo does not display from bash script
Date 2026-05-02 18:21 -0400
Organization A noiseless patient Spider
Message-ID <10t5tdc$2euog$1@dont-email.me> (permalink)
References <20260502201304.8dd1eeb5073cc5422b0fdc8a@gmail.com>

Show all headers | View raw


On 5/2/26 3:13 PM, pinnerite wrote:
> This is script. None of the echo lines display(?).
> 
> #!/bin/bash
> 
> LOGFILE="$HOME/myth_backup.log"
> TARGET="/media/alan/e06b3828-2ec7-493a-bfbc-dcdd04ac2fed"
> 
> echo "Backup started at $(date)" >> "$LOGFILE"
> 
> # Run MythTV backup
> #
> echo "Running mythconverg_backup.pl..." >> "$LOGFILE"
> /home/mythtv/mythconverg_backup.pl >> "$LOGFILE" 2>&1 || \
> echo "WARNING: mythconverg_backup.pl failed" >> "$LOGFILE"
> 
> # Rsync backup
> echo "Starting rsync..." >> "$LOGFILE"
> 
> if mountpoint -q "$TARGET"; then
>      if rsync -avh --delete /home/mythtv/ "$TARGET"/ >> "$LOGFILE" 2>&1; then
>          echo "Backup completed successfully at $(date)" >> "$LOGFILE"
>      else
>          echo "ERROR: rsync failed at $(date)" >> "$LOGFILE"
>      fi
> else
>      echo "ERROR: Backup target not mounted, skipping rsync" >> "$LOGFILE"
> fi
> 
> TIA Alan
> 
First, how are you running this?   Clicking on the shell script via Nemo, running from a 
cron job, running from a terminal window from the command line?

I know it's stupid but put all your variables in {}   ${LOGFILE} etc.

Try shellcheck on the script.   shellcheck <full path of script>
You can capture errors >logfile.txt if it's a lot.

-- 
Mint 22.3,  Thunderbird 140.10.0esr,  Firefox 150.0.1
     Alan K.

Back to alt.os.linux.mint | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

echo does not display from bash script pinnerite <pinnerite@gmail.com> - 2026-05-02 20:13 +0100
  Re: echo does not display from bash script "Alan K." <alan@invalid.com> - 2026-05-02 18:21 -0400
    Re: echo does not display from bash script "Alan K." <alan@invalid.com> - 2026-05-02 18:24 -0400
  Re: echo does not display from bash script Paul <nospam@needed.invalid> - 2026-05-02 18:51 -0400
    Re: echo does not display from bash script Mark Bourne <nntp.mbourne@spamgourmet.com> - 2026-05-03 13:00 +0100
      Re: echo does not display from bash script pinnerite <pinnerite@gmail.com> - 2026-05-05 21:39 +0100
  Re: echo does not display from bash script Lawrence D’Oliveiro <ldo@nz.invalid> - 2026-05-02 23:00 +0000

csiph-web