Sponsored Content
Top Forums Shell Programming and Scripting crontab doesn't allow `command` ?? Post 302354950 by tiger2000 on Monday 21st of September 2009 04:31:28 AM
Old 09-21-2009
crontab doesn't allow `command` ??

Dear All,

We wrote a script to clean email mailbox when they're nearly full and put it in cron :

0 0 * * * /root/quota/autoclean.sh > /root/quota/autoclean.`date '+%Y%m%d'` 2>&1

I've run this command from command prompt, it did work.
However, if running from cron, it returned such error in log :

/var/log/cron.1:Sep 18 05:00:01 mail1 crond[28695]: (root) CMD (/root/quota/autoclean.sh > /root/quota/autoclean.`date '+)

Could someone advise what's the reason for this?
Thanks.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Shell script doesn't get executed using crontab

I have the following crontab entry to run a shell script for every 30 minutes of every day: 30 * * * * $HOME/main.sh > $HOME/main.log 2>$HOME/error.log after I created the crontab file I have also done: $crontab my_crontab I also check to make sure it exists, by using the following... (11 Replies)
Discussion started by: radhika
11 Replies

2. Shell Programming and Scripting

Doesn't recognize the mv command

I'm nearly finished my program i've got everything in place and than when i run it it comes back with the reply mv: command not found. This is the code that seems to be causing the problem. elif then echo "There are more than one '$1' files in the system." echo "Please... (2 Replies)
Discussion started by: zoolz
2 Replies

3. Shell Programming and Scripting

When things doesn't run into crontab???

Could someone explain my problem? I've the following script... #! /bin/ksh ... vmquery -m $MediaID | awk ' BEGIN {FS=": " getline expdate <"ExpDate.txt" } $1 ~ /media ID/ {MediaNumber = $NF} ... $1 ~ /number of mounts/ { "date +%Y"|getline YearToday Year4 = YearToday - 4 if... (4 Replies)
Discussion started by: nymus7
4 Replies

4. Shell Programming and Scripting

Routine doesn't give output when executed in crontab

I have a script running in the crontab that gets data from a database every hour. Now I would like to execute a fortran routine to process the data in some way, after getting it and saving it locally. I have added the following commands to my script: set convert =... (1 Reply)
Discussion started by: SharkM
1 Replies

5. Shell Programming and Scripting

Expect script doesn't work under crontab

Hi All, Using Expect script when I run it manually it works. But when I put the entry in crontab, the job is still running after 15 hours. The script was created as root. I don't think it's a permission issue. Any idea? This is what I have under root crontab... 00 18 * * 1-5... (4 Replies)
Discussion started by: samnyc
4 Replies

6. Shell Programming and Scripting

cd command doesn't work through variables

Hi.... cd command is not working when dual string drive/volume name is passed to cd through variables....... For Ex.... y=/Volumes/Backup\ vipin/ cd $y the above command gives error....... anyone with a genuine solution ? (16 Replies)
Discussion started by: vipinchauhan222
16 Replies

7. Shell Programming and Scripting

IDL job doesn't work from crontab

I have made a script to execute an IDL routine with the purpose to plot data on a fixed time. The problem is that when I include this script in the crontab to run it every night, the IDL part doesn't work (the other commands, like getting data from the database, are carried out though). This... (4 Replies)
Discussion started by: SharkM
4 Replies

8. Shell Programming and Scripting

Command doesn't execute

Hi All. Little mystery here. I've been teaching myself perl, and I want to execute regular linux / unix commands i.e. cd .. , cd /etc and have been using the command(s) execute ("cd .."); or system ("cd .."); I don't get any error messages, even when I do a debug, but for some reason... (5 Replies)
Discussion started by: azrael2000
5 Replies

9. Shell Programming and Scripting

Job runs manually, doesn't work in crontab

I have a script (/home/admin/run_bkup.sh) that I can run manually to kick off an executable job. I want to run it in crontab, but it doesn't work. Here's the script: shell=/bin/bash today=$(date +"%m-%d-%y") /opt/CPsuite-R77/fw1/bin/upgrade_tools/upgrade_export mgt-svr-bkup-$today << EOF y... (18 Replies)
Discussion started by: df08388
18 Replies

10. Shell Programming and Scripting

Script containing Curl doesn't run with crontab

Hello I have a problem with the crontab command when I run a code containing Curl on the command line it runs without fail but as soon as I program it with crontab it executes everything except the curl returns fail thank you for helping me to resolve this problem because since Monday I look... (14 Replies)
Discussion started by: beautymind
14 Replies
SBUILD-UPDATE(1)						   Debian sbuild						  SBUILD-UPDATE(1)

NAME
sbuild-update - update, upgrade, and clean an sbuild chroot with apt-get SYNOPSIS
sbuild-update [-h|--help] [-V|--version] [--arch=architecture] [-u|--update] [-g|--upgrade] [-d|--dist-upgrade] [-c|--clean] [-a|--auto- clean] [-r|--autoremove] CHROOT1 [CHROOT2 [CHROOTn...]] sbuild-update -k|--keygen (DEPRECATED) sbuild-upgrade [-h|--help] [-V|--version] CHROOT1 [CHROOT2 [CHROOTn...]] (DEPRECATED) sbuild-distupgrade [-h|--help] [-V|--version] CHROOT1 [CHROOT2 [CHROOTn...]] (DEPRECATED) sbuild-clean [-h|--help] [-V|--version] [-c|--clean] [-a|--autoclean] [-r|--autoremove] CHROOT1 [CHROOT2 [CHROOTn...]] DESCRIPTION
sbuild-update runs apt-get inside the specified chroot performing update, upgrade, dist-upgrade, clean, autoclean, and/or autoremove depending on the options specified on the command line. sbuild-upgrade, sbuild-distupgrade, and sbuild-clean, are deprecated. They now simply run sbuild-update with the appropriate options (--upgrade or --dist-upgrade for sbuild-upgrade or sbuild-distupgrade respectively) along with whatever arguments were passed in the scripts. OPTIONS
Actions -h, --help Display this manual. -V, --version Print version information. --arch=architecture Update chroot for the architecture specified. -u, --update Perform an apt-get update. -g, --upgrade Perform an apt-get upgrade. -d, --dist-upgrade Perform an apt-get dist-upgrade. -c, --clean Perform an apt-get clean. -a, --autoclean Perform an apt-get autoclean. -r, --autoremove Perform an apt-get autoremove. -k, --keygen Generate a GPG public/private key pair for self-signing local apt archives, used for installation of dependency packages. Note that this requires a significant amount of entropy (randomness) and may hang on systems with poor entropy sources, such as headless sys- tems without direct user input. In this situation, it is advisable to create the key on a trusted local system, and copy the files to the build system by hand from /var/lib/sbuild/apt-keys/. Chroot selection CHROOT The chroot to use. Note that 'o', 's', 't', 'u' and 'e' may be used as abbreviations for 'oldstable', 'stable', 'testing', 'unsta- ble' and 'experimental', respectively. EXAMPLES
To update the unstable chroot: % sbuild-update --update unstable To upgrade the unstable chroot: % sbuild-update --upgrade unstable To clean the unstable chroot: % sbuild-update --clean unstable To perform an update, dist-upgrade, clean, autoclean, and autoremove for the unstable chroot: % sbuild-update -udcar unstable AUTHORS
Roger Leigh. Andres Mejia. COPYRIGHT
Copyright (C) 2006-2009 Roger Leigh <rleigh@debian.org>. Copyright (C) 2010 Andres Mejia <mcitadel@gmail.com>. SEE ALSO
sbuild(1), sbuild-apt(1), Version 0.63.2 18 Aug 2012 SBUILD-UPDATE(1)
All times are GMT -4. The time now is 01:31 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy