Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 10 Apr 2019 16:14:43 -0500
From:      Software Info <softwareinfojam@gmail.com>
To:        Jonathan Chen <jonc@chen.org.nz>
Cc:        "freebsd-stable@freebsd.org" <freebsd-stable@freebsd.org>
Subject:   RE: Crontab Question
Message-ID:  <5cae5cc3.1c69fb81.15e0.dbd1@mx.google.com>
In-Reply-To: <CAJuc1zNRcG5WaZ4weC=TNLuXCfT=oxMtismm%2B6apWXEtJZhH3A@mail.gmail.com>
References:  <5cae4e6f.1c69fb81.95785.62bf@mx.google.com> <CAJuc1zNRcG5WaZ4weC=TNLuXCfT=oxMtismm%2B6apWXEtJZhH3A@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
OK. So although the script is located in my home directory, it doesn=E2=80=
=99t start there?  Sorry but I don=E2=80=99t quite understand. Could you ex=
plain a little further please?

Regards
SI

Sent from Mail for Windows 10

From: Jonathan Chen
Sent: Wednesday, April 10, 2019 3:50 PM
To: Software Info
Cc: freebsd-stable@freebsd.org
Subject: Re: Crontab Question

On Thu, 11 Apr 2019 at 08:18, Software Info <softwareinfojam@gmail.com> wro=
te:
>
> Hi All
> I am trying to schedule cron to run a script. The script is in my home di=
rectory and so I added my home directory to the path file in /etc/crontab b=
elow.
> PATH=3D/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin:~/bin=
:/home:/home/me
>
> This is the crontab entry for the scheduled  task below.
> 49      14      *       *       1-5     root    myscript.sh
>
> myscript.sh grabs a file from another directory if it is there. If not, i=
t says =E2=80=9Cfile not uploaded=E2=80=9D. If the file is there, it copies=
 it to my home directory, strips email addresses out of it and uses mailx t=
o send emai to those users. I keep getting the error that a number of files=
 in my home directory are missing but they are not.
>
> Please see errors below
> mv: rename *.csv to listing.csv: No such file or directory
> grep: listing.csv: No such file or directory
> /home/me/ipo-script.sh: cannot open body.txt: No such file or directory
> mv: rename /home/me/listing.txt to /home/me/listing.txt-10-04-19-1435: No=
 such file or directory
> mv: rename /home/me/listing.csv to /home/me/listing.csv-10-04-19-1435: No=
 such file or directory
> mv: rename /home/me/listing.txt-10-04-19-1435 to /home/me/IPO-Backup-File=
s/listing.txt-10-04-19-1435: No such file or directory
> mv: rename /home/me/listing.csv-10-04-19-1435 to /home/me/IPO-Backup-File=
s/listing.csv-10-04-19-1435: No such file or directory
>
> Because I added my home directory to the path in crontab, I am at a loss =
to explain why this is still happening. Anyone have any ideas? Would really=
 appreciate some help.

You are assuming that the script starts in your home directory. It
doesn't, hence: "mv: rename *.csv to listing.csv: No such file or
directory"
--=20
Jonathan Chen <jonc@chen.org.nz>




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?5cae5cc3.1c69fb81.15e0.dbd1>