From owner-freebsd-stable@freebsd.org Wed Apr 10 20:50:20 2019 Return-Path: Delivered-To: freebsd-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C975D156C9A0 for ; Wed, 10 Apr 2019 20:50:19 +0000 (UTC) (envelope-from jonc@chen.org.nz) Received: from mail-vk1-xa2f.google.com (mail-vk1-xa2f.google.com [IPv6:2607:f8b0:4864:20::a2f]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A5F9F8A509 for ; Wed, 10 Apr 2019 20:50:17 +0000 (UTC) (envelope-from jonc@chen.org.nz) Received: by mail-vk1-xa2f.google.com with SMTP id q189so878513vkq.11 for ; Wed, 10 Apr 2019 13:50:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chen-org-nz.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=BFr4PGb8VwU+n3heyfuLUZOEUDer6l2bFS4IyNA6Z30=; b=GUCOIAFVZi6N+Up60pkleJ0d1xn56QCa1TnXw/i7xcFb9X1Xw+gpKhAudxvZUo0k+t aFFo175w1/2ZxsXjqqIl5ESRDw12YSwniuBW+zZOJ7/96IijE51DTTDLQHL98Q//2rN3 8+AYaohtVG5VVNPsDApu6ICX7j4TNRpIneGJExxLEmDJROHyHPz6wk+EvkyyEPHfEb8R S+1FCgylgkXgStoIEyE+A8MraUORVELDYOZ4JwyDBd3cE1112JRt2akphNel3o3oYi70 voKblYy0ebLkG1nMm8n3hx1ZcJkkDq5hqkFCUtKoXoGtoDe2OHlWri1qlza/WB2BdrZ1 VpHw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=BFr4PGb8VwU+n3heyfuLUZOEUDer6l2bFS4IyNA6Z30=; b=UPrFjolwoGEnhvjq33/yv6CSfKZ4tSuOxPGYQ9qEnz5aXIpurXjjrlPInDeqTchydY pF3XVyBfWBpuT2t2nK6WycLGFcuscQ/TkEFoLQbZHgcA+DiUwTgOzQG8zsdPaPTUWoIo FYU+nNEvv7x9euqBGQZPuuVQAzrf7unr+Q11Gz55r3BjG/U+K90xvRrMJMlv3ry8Non4 C7VKqLD8caKaOVOwZ6tsm5lz8ktBtijiqQcXM5hJOnj4+spJNAHhcQfbnXE6C7Cg84h0 0BUksCyK69+a3yp7kpk69Ci66LBACacWOcCqiFz1bck5m0hXXtEROnuIh8CEKnYAY0bj p1zg== X-Gm-Message-State: APjAAAXNeIe2UbtOLTRuUTdVqYM2w3yg/2BqV1BCXO9aalKUSvV3pNEo yXT/96ARDIwjjYxYw39cLd2pgbGWxlJFHeoWOT2XxA== X-Google-Smtp-Source: APXvYqwaBdMKbrjIlGgJafKfB+F/sqLP0Qq5oSHICxq1ty5qEjq5byyWttE095gQ5DaP/7MWqPw2p2xnYlsSh5FZTpA= X-Received: by 2002:a1f:b297:: with SMTP id b145mr24835171vkf.74.1554929416765; Wed, 10 Apr 2019 13:50:16 -0700 (PDT) MIME-Version: 1.0 References: <5cae4e6f.1c69fb81.95785.62bf@mx.google.com> In-Reply-To: <5cae4e6f.1c69fb81.95785.62bf@mx.google.com> From: Jonathan Chen Date: Thu, 11 Apr 2019 08:50:00 +1200 Message-ID: Subject: Re: Crontab Question To: Software Info Cc: "freebsd-stable@freebsd.org" Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Rspamd-Queue-Id: A5F9F8A509 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org; dkim=pass header.d=chen-org-nz.20150623.gappssmtp.com header.s=20150623 header.b=GUCOIAFV X-Spamd-Result: default: False [-6.13 / 15.00]; ARC_NA(0.00)[]; TO_DN_EQ_ADDR_SOME(0.00)[]; R_DKIM_ALLOW(-0.20)[chen-org-nz.20150623.gappssmtp.com:s=20150623]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; NEURAL_HAM_SHORT(-0.94)[-0.940,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[freebsd-stable@freebsd.org]; DMARC_NA(0.00)[chen.org.nz]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[chen-org-nz.20150623.gappssmtp.com:+]; RCPT_COUNT_TWO(0.00)[2]; RCVD_IN_DNSWL_NONE(0.00)[f.2.a.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.b.8.f.7.0.6.2.list.dnswl.org : 127.0.5.0]; MX_GOOD(-0.01)[alt1.aspmx.l.google.com]; R_SPF_NA(0.00)[]; FREEMAIL_TO(0.00)[gmail.com]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; RCVD_COUNT_TWO(0.00)[2]; IP_SCORE(-2.88)[ip: (-9.19), ipnet: 2607:f8b0::/32(-2.96), asn: 15169(-2.19), country: US(-0.06)] X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Apr 2019 20:50:20 -0000 On Thu, 11 Apr 2019 at 08:18, Software Info 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