From nobody Sun Sep 18 15:49:05 2022 X-Original-To: freebsd-questions@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4MVsgL1Z0xz4clNd for ; Sun, 18 Sep 2022 15:49:18 +0000 (UTC) (envelope-from paulbeard@gmail.com) Received: from mail-vs1-xe30.google.com (mail-vs1-xe30.google.com [IPv6:2607:f8b0:4864:20::e30]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1D4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4MVsgK2z7Bz3Tmj for ; Sun, 18 Sep 2022 15:49:17 +0000 (UTC) (envelope-from paulbeard@gmail.com) Received: by mail-vs1-xe30.google.com with SMTP id 129so27599602vsi.10 for ; Sun, 18 Sep 2022 08:49:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=to:subject:message-id:date:from:mime-version:from:to:cc:subject :date; bh=PG7glnT1pkrtB7Twfr6/VsDX8faZku3PVz5pO2Mp68Q=; b=ZZkxqHms3MM60k5a6DfMWA8CGB+4jgGlG3Q2/p7Ag4yVtTbIz6P1DP1JnMhjZevll+ 7VP/lmb755uKN/uUM61NKAgLWfZV+zMfJzuhR7hK7Pwud33bFcKCFdLCMEJmdWgwr5QR W3x2y+eJQl0CZh3z8/fD9p0q2S6A11nDUthSsx0ZuPNh/ZJdrtx7ozvWVmB6Onz2e91e DlWfn/P/AFLTU6AGrFE8or7bYh30+6X+Rt1Jso5QI7mT2kBtzgeG03Vldzq+g4x3IO7k 12tXNHRpSDijWprO9LSyTfC58jpPecsAJxN0nlAG7pP1lk34Fv8u2yLKBl9t0q7lOgAZ XBaA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date; bh=PG7glnT1pkrtB7Twfr6/VsDX8faZku3PVz5pO2Mp68Q=; b=GPRsSu2E6IefEBnlELiO/KCQs9jxVvYZHUFyRmK0W0jTsI/3keSUKk4kLJM/077mQV hpyIjaSLmadp7UsO81qVcD29lGd9FzIXgS3cLN/pQGD4MGwTzs8KpznUMJLvQ4Dx0lE6 1rPeCtX+m3DOZgqhZUlHV3bKkyWscInO3K66S1G7px5j7R9ywyyd/t8+NWUThJ0o/35B AT1pKbmu71QxIoje0ODE6F3jUhVR7YqPzM3fj1M3LwI9sdpGI9rlRyjjnFGPo1GRUwIf 9s5nvgYsut0wnw9/zozvsG+DP25Ez8EYN5ZdONiveemrJ1iJKrOhu+XX9IBsNpjfPajm YYfA== X-Gm-Message-State: ACrzQf1TzphHRuq62IORib8WnhmojjeDzh7Xqp9LumLdxGaUyC33A9sf f9mj6og6t97x+Q7wTOlSmtqJ6w2afp10Mm9Iu44s/gqNlU0= X-Google-Smtp-Source: AMsMyM5vygcLcx35BwBxWF8e0KwSvJMCsTYXzQPVjv5L+NhFiXADt+LGUKvjVcBWXq3zYBgK5/Qnrr/XofvL4e0MmnM= X-Received: by 2002:a05:6102:3350:b0:398:b9c3:5aaf with SMTP id j16-20020a056102335000b00398b9c35aafmr4821571vse.11.1663516156206; Sun, 18 Sep 2022 08:49:16 -0700 (PDT) List-Id: User questions List-Archive: https://lists.freebsd.org/archives/freebsd-questions List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-questions@freebsd.org X-BeenThere: freebsd-questions@freebsd.org MIME-Version: 1.0 From: paul beard Date: Sun, 18 Sep 2022 08:49:05 -0700 Message-ID: Subject: command works interactively but not in cron? To: FreeBSD-questions Content-Type: multipart/alternative; boundary="00000000000091a49d05e8f589d3" X-Rspamd-Queue-Id: 4MVsgK2z7Bz3Tmj X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20210112 header.b=ZZkxqHms; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (mx1.freebsd.org: domain of paulbeard@gmail.com designates 2607:f8b0:4864:20::e30 as permitted sender) smtp.mailfrom=paulbeard@gmail.com X-Spamd-Result: default: False [-2.72 / 15.00]; SUBJECT_ENDS_QUESTION(1.00)[]; NEURAL_HAM_SHORT(-1.00)[-0.999]; NEURAL_HAM_LONG(-0.98)[-0.985]; NEURAL_HAM_MEDIUM(-0.73)[-0.732]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20210112]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; FROM_HAS_DN(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; FREEMAIL_FROM(0.00)[gmail.com]; RCPT_COUNT_ONE(0.00)[1]; PREVIOUSLY_DELIVERED(0.00)[freebsd-questions@freebsd.org]; RCVD_IN_DNSWL_NONE(0.00)[2607:f8b0:4864:20::e30:from]; ARC_NA(0.00)[]; DWL_DNSWL_NONE(0.00)[gmail.com:dkim]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; DKIM_TRACE(0.00)[gmail.com:+]; TO_DN_ALL(0.00)[]; MID_RHS_MATCH_FROMTLD(0.00)[]; MLMMJ_DEST(0.00)[freebsd-questions@freebsd.org]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+,1:+,2:~]; RCVD_TLS_LAST(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; RCVD_COUNT_TWO(0.00)[2] X-ThisMailContainsUnwantedMimeParts: N --00000000000091a49d05e8f589d3 Content-Type: text/plain; charset="UTF-8" /usr/sbin/pkg query %o works fine interactively but if I use it to backup a list of installed pkgs in crontab, it fails: 00 4 * * * /usr/sbin/pkg query %o > /var/backups/installed.pkgs Usage: pkg query pkg query [-a] pkg query -F pkg query -e pkg query [-Cgix] <...> For more information see 'pkg help query.' What am I missing here? -- Paul Beard / www.paulbeard.org/ --00000000000091a49d05e8f589d3 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
/usr/sbin/pkg query %o works fine interactively but if I u= se it to backup a list of installed pkgs=C2=A0in crontab, it fails:=C2=A0
00 4 * * * =C2=A0 =C2=A0 =C2=A0/usr/sbin/pkg query %o >= ; /var/backups/installed.pkgs

Usage: pkg query <q= uery-format> <pkg-name>
=C2=A0 =C2=A0 =C2=A0 =C2=A0pkg query [-= a] <query-format>
=C2=A0 =C2=A0 =C2=A0 =C2=A0pkg query -F <pkg-= name> <query-format>
=C2=A0 =C2=A0 =C2=A0 =C2=A0pkg query -e &l= t;evaluation> <query-format>
=C2=A0 =C2=A0 =C2=A0 =C2=A0pkg que= ry [-Cgix] <query-format> <pattern> <...>

For more= information see 'pkg help query.'

=
What am I missing here?=C2=A0
--
Paul Beard / www.paulbeard.org/
--00000000000091a49d05e8f589d3--