[HELP] Editing Crontab

Discussion about using NAS on Linux and Unix OS.

[HELP] Editing Crontab

Postby wechap » Fri Jan 25, 2008 10:40 am

Hello All

I'm a complete noob to Unix. I am trying to edit the crontab file, i can edit it by tryping

crontab -e admin

I can then make changes etc, then i try to save it with :wq but it never saves the changes. I'm obviously doing something wrong I just can't figure out what. Using an outdated Linux Handbook doesn't help iether.

Thanks in advance
wechap
Last edited by wechap on Fri Jan 25, 2008 2:04 pm, edited 2 times in total.
wechap
Cadet
 
Posts: 49
Joined: Tue Jan 22, 2008 8:56 am
Location: Australia

Re: [HELP] Editing Crontab

Postby wechap » Fri Jan 25, 2008 1:23 pm

Figured it out :wink:
wechap
Cadet
 
Posts: 49
Joined: Tue Jan 22, 2008 8:56 am
Location: Australia

Re: [HELP] Editing Crontab

Postby wechap » Fri Jan 25, 2008 2:10 pm

I thought I had figured it out :evil:

I created a txt file called cron.txt with the modified commands and ran crontab cron.txt, I than ran crontab -l to make sure the change had worked and all looked ok, but after rebooting i am back to the default crontab.

I am trying to change the imr_all command so that it only runs on the folder that contains the pictures instead of all the folders in my Qmultimedia share, otherwise it runs for hours before it completes.

Anyone know why the crontab would reset to the default?
wechap
Cadet
 
Posts: 49
Joined: Tue Jan 22, 2008 8:56 am
Location: Australia

Re: [HELP] Editing Crontab

Postby Stephen Howard » Fri Jan 25, 2008 2:48 pm

Hi. Changes to /etc don't survive a reboot. However, QNAP have provided a method to automatically recreate customisations after every reboot:

The way to do it is to put your customisations in autorun.sh, a script that qnap runs immediately after a reboot. autorun.sh is hidden away on a partition that is normally unmounted, but it can be accessed as follows (for my dual disk 209 anyway):

# mount /dev/mtdblock5 /tmp/config
# cd /tmp/config

Add your modifications to autorun.sh and then unmount the partition:

# cd /
# umount /tmp/config

From now on your customisations will be automatically recreated on every reboot.
Stephen Howard
Cadet
 
Posts: 19
Joined: Thu Dec 13, 2007 9:54 am
Location: Australia

Re: [HELP] Editing Crontab

Postby wechap » Fri Jan 25, 2008 3:59 pm

Thanks Stephen, works nicely
wechap
Cadet
 
Posts: 49
Joined: Tue Jan 22, 2008 8:56 am
Location: Australia

Re: [HELP] Editing Crontab

Postby christian » Sun May 11, 2008 6:00 am

Stephen Howard wrote:Add your modifications to autorun.sh and then unmount the partition:

Hello Stephen,

please can you explain to me what excactly is to change or to add when i have changed the crontab ?
Code: Select all
[~] # mount /dev/mtdblock5 /tmp/config
[~] # cd /tmp/config
[/tmp/config] # cat autorun.sh
#!/bin/sh


# added by SSODS (ssods-ts $Revision: 1.3 $) on Sun Apr 20 00:08:15 CEST 2008
ln -sf /share/HDA_DATA /volume1 # SSODS (keep the tag!)
/volume1/SSODS/etc/init.d/rc.ssods start # SSODS (keep the tag!)
[/tmp/config] #


regards Christian
Image
Deutsches Qnap Forum -> http://www.qnapclub.de
User avatar
christian
Gold Warrior
 
Posts: 924
Joined: Tue Sep 04, 2007 5:27 pm
Location: Germany
NAS Model: TS-119/219

Re: [HELP] Editing Crontab

Postby lou2step » Sun Aug 09, 2009 3:22 pm

Hi wechap,
Just one remark upon crontab : if you have already tasks in the crontab, don't forget to save them :
Code: Select all
crontab -e >crontab.txt

then you can edit and complete crontab.txt.
Code: Select all
crontab crontab.txt

Anyway, it don't solve the reboot problem.
Lou2step
Lou2step
TS-109 Pro
lou2step
Cadet
 
Posts: 6
Joined: Wed Sep 03, 2008 4:34 am
NAS Model: TS-109/209 Pro

Re: [HELP] Editing Crontab

Postby v2k » Mon Oct 26, 2009 3:35 am

I run crontab -e; make some changes, save them.

Then I run crontab -l or crontab -e and the changes are gone.

I also tried stopping crond, editing /etc/config/crobtab and restarting crond; again my changes are gone.

Anyone had this problem?
TS-509 Pro
v2k
Crystal Warrior
 
Posts: 104
Joined: Mon Feb 23, 2009 4:28 pm
NAS Model: TS-509 Pro

Re: [HELP] Editing Crontab

Postby Eraser-EMC2- » Mon Oct 26, 2009 5:15 am

Hi,

edit the crontab in /etc/config as before and then run "crontab /etc/config/crontab".
This will configure the crontab with your new entries.
_________________
Windows 7 32/64bit, German
TS-239 , 2x 2TB Samsung
Microsoft-Network, SAMBA as NT4 PDC, DHCP/DNS-Server, Web Server, MySql
TS-439 , 4x 1,5TB WD, Microsoft-Network
Microsoft-Network
Eraser-EMC2-
Silver Warrior
 
Posts: 343
Joined: Sat Oct 13, 2007 5:26 pm
Location: Germany
NAS Model: TS-239 Pro

Re: [HELP] Editing Crontab

Postby v2k » Mon Oct 26, 2009 5:37 am

Perfect, thank you!
TS-509 Pro
v2k
Crystal Warrior
 
Posts: 104
Joined: Mon Feb 23, 2009 4:28 pm
NAS Model: TS-509 Pro

Next

Return to Linux & Unix (NFS)

Who is online

Users browsing this forum: No registered users and 1 guest