Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 11 Apr 2019 08:50:00 +1200
From:      Jonathan Chen <jonc@chen.org.nz>
To:        Software Info <softwareinfojam@gmail.com>
Cc:        "freebsd-stable@freebsd.org" <freebsd-stable@freebsd.org>
Subject:   Re: Crontab Question
Message-ID:  <CAJuc1zNRcG5WaZ4weC=TNLuXCfT=oxMtismm%2B6apWXEtJZhH3A@mail.gmail.com>
In-Reply-To: <5cae4e6f.1c69fb81.95785.62bf@mx.google.com>
References:  <5cae4e6f.1c69fb81.95785.62bf@mx.google.com>

next in thread | previous in thread | raw e-mail | index | archive | help
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?CAJuc1zNRcG5WaZ4weC=TNLuXCfT=oxMtismm%2B6apWXEtJZhH3A>