FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Redhat > Fedora User

 
 
LinkBack Thread Tools
 
Old 02-16-2011, 12:43 PM
Tom Horsley
 
Default crontab error

On Wed, 16 Feb 2011 08:33:30 -0500
Robert Moskowitz wrote:

> This is on F12.
>
> When I edit /etc/crontab (SUed as root, using VI) I see the following in
> /var/log/cron after I save crontab:
>
> Feb 16 00:39:02 hda crond[1541]: (*system*) RELOAD (/etc/crontab)
> Feb 16 00:39:02 hda crond[1541]: (CRON) bad username (/etc/crontab)
>
> My crontab content is:
>
> # cat crontab
> SHELL=/bin/bash
> PATH=/sbin:/bin:/usr/sbin:/usr/bin
> MAILTO=root
> HOME=/
>
> # For details see man 4 crontabs
>
> # Example of job definition:
> # .---------------- minute (0 - 59)
> # | .------------- hour (0 - 23)
> # | | .---------- day of month (1 - 31)
> # | | | .------- month (1 - 12) OR jan,feb,mar,apr ...
> # | | | | .---- day of week (0 - 6) (Sunday=0 or 7) OR
> sun,mon,tue,wed,thu,fri,sat
> # | | | | |
> # * * * * * command to be executed
> 1 4 * * * /usr/bin/rsync -a /home/ /media/2GHJTCB4/backups/hda/home

The /etc/crontab file is slightly different format than a normal
per-user crontab file. It has to have a user name added before the
command, so that should be:

1 4 * * * root /usr/bin/rsync -a /home/ /media/2GHJTCB4/backups/hda/home

If you read the various crontab man pages about 15 times you can
almost discover this is documented :-).
--
users mailing list
users@lists.fedoraproject.org
To unsubscribe or change subscription options:
https://admin.fedoraproject.org/mailman/listinfo/users
Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines
 
Old 02-16-2011, 12:44 PM
iarly selbir
 
Default crontab error

is missing username on your cronjob, your line should something like this:
1 4 * * * root /usr/bin/rsync -a /home/ /media/2GHJTCB4/backups/hda/home

where "root" is the user that will execute the command.

- -
iarlyy selbir

:wq!



On Wed, Feb 16, 2011 at 10:33 AM, Robert Moskowitz <rgm@htt-consult.com> wrote:

This is on F12.



When I edit /etc/crontab (SUed as root, using VI) I see the following in

/var/log/cron after I save crontab:



Feb 16 00:39:02 hda crond[1541]: (*system*) RELOAD (/etc/crontab)

Feb 16 00:39:02 hda crond[1541]: (CRON) bad username (/etc/crontab)



My crontab content is:



# cat crontab

SHELL=/bin/bash

PATH=/sbin:/bin:/usr/sbin:/usr/bin

MAILTO=root

HOME=/



# For details see man 4 crontabs



# Example of job definition:

# .---------------- minute (0 - 59)

# | �.------------- hour (0 - 23)

# | �| �.---------- day of month (1 - 31)

# | �| �| �.------- month (1 - 12) OR jan,feb,mar,apr ...

# | �| �| �| �.---- day of week (0 - 6) (Sunday=0 or 7) OR

sun,mon,tue,wed,thu,fri,sat

# | �| �| �| �|

# * �* �* �* �* �command to be executed

1 4 * * * /usr/bin/rsync -a /home/ /media/2GHJTCB4/backups/hda/home





--

users mailing list

users@lists.fedoraproject.org

To unsubscribe or change subscription options:

https://admin.fedoraproject.org/mailman/listinfo/users

Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines



--
users mailing list
users@lists.fedoraproject.org
To unsubscribe or change subscription options:
https://admin.fedoraproject.org/mailman/listinfo/users
Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines
 
Old 02-16-2011, 12:59 PM
Robert Moskowitz
 
Default crontab error

On 02/16/2011 08:43 AM, Tom Horsley wrote:
> On Wed, 16 Feb 2011 08:33:30 -0500
> Robert Moskowitz wrote:
>
>> This is on F12.
>>
>> When I edit /etc/crontab (SUed as root, using VI) I see the following in
>> /var/log/cron after I save crontab:
>>
>> Feb 16 00:39:02 hda crond[1541]: (*system*) RELOAD (/etc/crontab)
>> Feb 16 00:39:02 hda crond[1541]: (CRON) bad username (/etc/crontab)
>>
>> My crontab content is:
>>
>> # cat crontab
>> SHELL=/bin/bash
>> PATH=/sbin:/bin:/usr/sbin:/usr/bin
>> MAILTO=root
>> HOME=/
>>
>> # For details see man 4 crontabs
>>
>> # Example of job definition:
>> # .---------------- minute (0 - 59)
>> # | .------------- hour (0 - 23)
>> # | | .---------- day of month (1 - 31)
>> # | | | .------- month (1 - 12) OR jan,feb,mar,apr ...
>> # | | | | .---- day of week (0 - 6) (Sunday=0 or 7) OR
>> sun,mon,tue,wed,thu,fri,sat
>> # | | | | |
>> # * * * * * command to be executed
>> 1 4 * * * /usr/bin/rsync -a /home/ /media/2GHJTCB4/backups/hda/home
> The /etc/crontab file is slightly different format than a normal
> per-user crontab file. It has to have a user name added before the
> command, so that should be:
>
> 1 4 * * * root /usr/bin/rsync -a /home/ /media/2GHJTCB4/backups/hda/home
>
> If you read the various crontab man pages about 15 times you can
> almost discover this is documented :-).

OH, yes, NOW I remember this from the LAST time I did this (I am
rebuilding a system that lost its harddrive without proper backups)...

Thanks all.


--
users mailing list
users@lists.fedoraproject.org
To unsubscribe or change subscription options:
https://admin.fedoraproject.org/mailman/listinfo/users
Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines
 
Old 02-16-2011, 01:03 PM
Frank Elsner
 
Default crontab error

On Wed, 16 Feb 2011 08:33:30 -0500 Robert Moskowitz wrote:
> This is on F12.
>
> When I edit /etc/crontab (SUed as root, using VI) I see the following in
> /var/log/cron after I save crontab:
>
> Feb 16 00:39:02 hda crond[1541]: (*system*) RELOAD (/etc/crontab)
> Feb 16 00:39:02 hda crond[1541]: (CRON) bad username (/etc/crontab)
>
> My crontab content is:
>
> # cat crontab
> SHELL=/bin/bash
> PATH=/sbin:/bin:/usr/sbin:/usr/bin
> MAILTO=root
> HOME=/
>
> # For details see man 4 crontabs
>
> # Example of job definition:
> # .---------------- minute (0 - 59)
> # | .------------- hour (0 - 23)
> # | | .---------- day of month (1 - 31)
> # | | | .------- month (1 - 12) OR jan,feb,mar,apr ...
> # | | | | .---- day of week (0 - 6) (Sunday=0 or 7) OR
> sun,mon,tue,wed,thu,fri,sat
> # | | | | |
> # * * * * * command to be executed

For /etc/crontab this comment is crap, last line should read
# * * * * * username <command to be executed>

> 1 4 * * * /usr/bin/rsync -a /home/ /media/2GHJTCB4/backups/hda/home

1 4 * * * root bin/rsync -a /home/ /media/2GHJTCB4/backups/hda/home

should do the job.


--Frank Elsner
--
users mailing list
users@lists.fedoraproject.org
To unsubscribe or change subscription options:
https://admin.fedoraproject.org/mailman/listinfo/users
Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines
 

Thread Tools




All times are GMT. The time now is 09:18 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org