1 |
On Sun, 19 Jun 2011 15:37:42 -0700, Grant wrote about [gentoo-user] |
2 |
crontab not executing: |
3 |
|
4 |
> One of my systems has a crontab like this to clean up and consolidate |
5 |
> the output of the video monitoring app "motion": |
6 |
> |
7 |
> # crontab -l |
8 |
> # DO NOT EDIT THIS FILE - edit the master and reinstall. |
9 |
> # (/home/grant/cron.root.txt installed on Sat Sep 25 10:42:18 2010) |
10 |
> # (Cron version V5.0 -- $Id: crontab.c,v 1.12 2004/01/23 18:56:42 |
11 |
> vixie Exp $) 50 23 * * * /bin/rm /home/motion/$(date -d 'yesterday' |
12 |
> +%Y%m%d)*.jpg 55 23 * * * /bin/rm /home/motion/$(date -d 'yesterday' |
13 |
> +%Y%m%d)*.avi 59 23 * * * /usr/bin/mencoder /home/motion/$(date |
14 |
> +%Y%m%d)*.avi -noidx -o /home/motion/full-$(date +%Y%m%d).avi -ovc |
15 |
> copy -oac copy |
16 |
> |
17 |
> If I execute each command manually, it works great, but nothing |
18 |
> happens otherwise. Can someone tell me why this crontab doesn't seem |
19 |
> to be executing? |
20 |
|
21 |
For starters, you don't have any environment variables assigned at the |
22 |
top of your crontab. Here is mine: |
23 |
|
24 |
# Establish environment variables. |
25 |
JAVA_HOME='/etc/java-config-2/current-system-vm' |
26 |
PATH='/home/dwn/bin:/usr/local/bin:/bin:/usr/bin:/etc/java-config-2/current-system-vm/bin:/etc/java-config-2/current-system-vm/jre/bin:/opt/bin' |
27 |
TMPDIR='/tmp' |
28 |
HOME='/home/dwn' |
29 |
SHELL='/bin/zsh' |
30 |
LOGNAME='dwn' |
31 |
LC_ALL='en_GB.UTF-8' |
32 |
http_proxy='http://localhost:8080' |
33 |
ftp_proxy='http://localhost:8080' |
34 |
RSYNC_PROXY='localhost:8080' |
35 |
ZFTP_PREFS='P' |
36 |
PGHOST='' |
37 |
PGPORT='' |
38 |
|
39 |
# Set our priority level. |
40 |
!nice(4) |
41 |
|
42 |
# Clean up old backup files. |
43 |
%daily 38 20 find "$HOME/" \( -name \*~ -o -iname \*.bak -o -iname \*.bak\? \) -print -delete |
44 |
|
45 |
# Clean out the work directory for Lazarus. |
46 |
%daily 18 05 find "$HOME/Lazarus_projects/tmp/" -mindepth 1 -delete |
47 |
|
48 |
# Download the development trunk of Free Pascal compiler. |
49 |
%daily 13 07 fpc_download.zsh |
50 |
|
51 |
# Purge old mailing list messages from Free Pascal. |
52 |
%daily 37 04 mail_purge.py '6d5c5c5a8aa90d8a' |
53 |
|
54 |
# Clear the cache for epiphany. |
55 |
%daily 27 06 cd "$HOME/.gnome2/epiphany/mozilla/epiphany" && rm -rf |
56 |
compreg.dat pluginreg.dat Cache .parentlock |
57 |
|
58 |
# Clean out old GNOME sessions. |
59 |
#%hourly 13 find "$HOME/.config/gnome-session/saved-session/" -mindepth |
60 |
1 -name \*.desktop -delete |
61 |
|
62 |
# Clean out the cache subdirectories under $HOME. |
63 |
%daily 28 06 cache_clean.zsh |
64 |
|
65 |
# Check Portage for orphans. |
66 |
#%daily 32 06 portage_orphans.zsh |
67 |
-- |
68 |
Regards, |
69 |
|
70 |
Dave [RLU #314465] |
71 |
*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-* |
72 |
dwnoon@××××××××.com (David W Noon) |
73 |
*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-* |