adding cron job to 0.1b5

273 views
Skip to first unread message

knireis

unread,
Dec 7, 2010, 10:25:56 AM12/7/10
to Alt-F
I'm using alt-f 0.1b5 and i would like to know how to add a cron job.
I turned cron on in the webinterface but there is no button to
configure it.

Joao Cardoso

unread,
Dec 7, 2010, 11:43:01 AM12/7/10
to Alt-F
Yes... you have to do that "by hand" in the command line.

In order for your changes to be persistent upon reboot or powerdown,
you need to install at least one Alt-F package (the ipkg package will
be enough).
The cronjobs will then reside on disk (which might make it to not
spindown, I'm not sure)
If you do it, please report back if it works across reboot.

What are your suggestions for the GUI, particularly how to enter the
command to execute?
Most of the time it has to be a script, which you have to write and
test... not very suitable for a GUI.

It is in my TODO list, but I have not yet solved the above question.

knireis

unread,
Dec 7, 2010, 12:39:33 PM12/7/10
to Alt-F
Like many others i like to make a nightly back from disk a to disk b.
On the forum there is a tutorial which describes this. With the help
of the editcron.sh file and funplug you can add cron items.
So for me it would be enough if i could create a cronjob with
following command:
rsync -av --delete --exclude XXX/ --backup --backup-dir=/mnt/HD_b2/
rsync_save /mnt/HD_a2 /mnt/HD_b2 >> /mnt/HD_a2/dns-323.log 2>&1

If this can be done from the webinterface it would be perfect for all
linux newbies.
If not, can you describe how to add it via command line?

Joao Cardoso

unread,
Dec 7, 2010, 1:46:52 PM12/7/10
to Alt-F


On Dec 7, 5:39 pm, knireis <mail...@jsierink.nl> wrote:
> Like many others i like to make a nightly back from disk a to disk b.
> On the forum there is a tutorial which describes this. With the help
> of the editcron.sh file and funplug you can add cron items.
> So for me it would be enough if i could create a cronjob with
> following command:
> rsync -av --delete --exclude XXX/ --backup --backup-dir=/mnt/HD_b2/
> rsync_save /mnt/HD_a2 /mnt/HD_b2 >> /mnt/HD_a2/dns-323.log 2>&1
>
> If this can be done from the webinterface it would be perfect for all
> linux newbies.

It is in my plans to add a backup web page for 0.1B6 to perform
backups, not only from partition to partition but also from remote smb
and nfs filesystems, awaking up the remote hosts first, and without
the need to install any extra software on the hosts.
(and, who knows, mirroring http and ftp servers also?)

> If not, can you describe how to add it via command line?

After you have started cron, which, by the way, you can do using
"rccron start" (or stop or status) in the command line, type in the
command line:

crontab -l > crontab.lst # list the current cron jobs to the file
crontab.lst
echo "0 6 * * * rsync -av --delete --exclude XXX/ --backup --backup-
dir=/mnt/HD_b2" >> crontab.lst
crontab crontab.lst # make cron use the new crontab

-These are *three* lines. Watch-out for line breaks that google might
gently add
-If you now type "crontab -l" you will see the current cron jobs.
-This is untested, please report your experiences. Remember to first
install any Alt-F package, to make the changes permanent on disk, not
only on volatile RAM.
-Of course you have to change the /mnt/HD_* by the actual paths and
the hour you want the job to be run -- in the above case, everyday at
6 o'clock in the morning. The XXX/ is unknown to me.
-Use this only once, as the >> in the second command appends the new
command to existing ones
-you can alternatively edit the crontab.lst file after the second
command, before adding it to the cron jobs in command three.

Joao Cardoso

unread,
Dec 7, 2010, 1:57:47 PM12/7/10
to Alt-F

> crontab -l > crontab.lst # list the current cron jobs to the file
> crontab.lst
> echo "0 6 * * * rsync -av --delete --exclude XXX/ --backup --backup-
> dir=/mnt/HD_b2" >> crontab.lst
> crontab crontab.lst # make cron use the new crontab

Of course the lines where wrapped, and the command is incomplete

crontab -l > crontab.lst
echo "0 6 * * * your command" >> crontab.lst
crontab crontab.lst

you should first try your command typing it in the command line, to
see if there are any errors.

knireis

unread,
Dec 7, 2010, 3:24:22 PM12/7/10
to Alt-F
Thanks for the support sofar, but I found an easier solution for me,
since i have another server running (sheevaplug) i mounted both
partitions on the sheeva and run the cronjob from there.
But your backup solution planned for b6 looks promising.
Reply all
Reply to author
Forward
0 new messages