Welcome, Guest. Please login or register.
Did you miss your activation email?
Sunday 24 November 2024, 01:04:33 am

Login with username, password and session length

The Latest Endian Firewall is now available for download HERE
14258 Posts in 4377 Topics by 6517 Members
Latest Member: Sandro
Search:     Advanced search
+  EFW Support
|-+  Support
| |-+  General Support
| | |-+  EFW 2.5.1 - Unable to edit crontab [solved circumventing the problem]
0 Members and 0 Guests are viewing this topic. « previous next »
Pages: [1] Go Down Print
Author Topic: EFW 2.5.1 - Unable to edit crontab [solved circumventing the problem]  (Read 22755 times)
bingel
Full Member
***
Offline Offline

Posts: 11


« on: Tuesday 25 September 2012, 12:58:30 am »

I would like to edit root crontab in way to automatically shutdown my firewall.
I tried:

Code:
fcrontab -e

but I obtain this error:

Code:
16:54:13 fcrontab : editing root's fcrontab
16:54:13 Error while running "/bin/vi": No such file or directory
16:54:13 could not stat /tmp/fcr-NapHVp: No such file or directory
16:54:13 could not remove /tmp/fcr-NapHVp: No such file or directory

Both vi and nano are correctly installed and running.
Logged
fqureshi
Sr. Member
****
Offline Offline

Posts: 126


« Reply #1 on: Tuesday 25 September 2012, 06:50:03 am »

Consider making your changes to the following files as per your need:

cron.daily/  It runs daily and execute at 1:25 midnnight   
cron.hourly/   it runs every hour ....01  * * * * every hour
cron.monthly/ 
cron.weekly/

Create a file in the directory and give following permissions

chmod 0777 <filename>

It depends under which folder you create the file and it will be run respected to the folder parameters under /etc/cron

Hope this helps
Logged
bingel
Full Member
***
Offline Offline

Posts: 11


« Reply #2 on: Tuesday 25 September 2012, 11:36:03 am »

Already tried but, unless I forgot to set permissions or to restart cron, I think it did not work. Now I will try again paying more attention to permission and then I'll make my report.

I used this script:

Code:
#!/bin/sh
shutdown -h 1:30
Logged
fqureshi
Sr. Member
****
Offline Offline

Posts: 126


« Reply #3 on: Tuesday 25 September 2012, 11:44:48 am »

Cheers
Logged
bingel
Full Member
***
Offline Offline

Posts: 11


« Reply #4 on: Tuesday 25 September 2012, 09:52:07 pm »

You were right!
I think I forgot to restart "cron" after the various changes and especially after changing the system time to test the functioning of the script.

Thanks again.


Following (as a reminder and to help others) is a summary of what was done:

-logged via ssh (as you probably know)

-generated a script for shutdown (change "1:30" with the time you prefer):

Code:
cat > /etc/cron.daily/autoshutdown [RETURN]
#!/bin/sh [RETURN]
[RETURN]
shutdown -h 1:30 [RETURN]
[CTRL+C]

-set permissions:

Code:
chmod 755 /etc/cron.daily/autoshutdown

-restarted cron:

Code:
./etc/init.d/fcron restart
Logged
gege
Jr. Member
*
Offline Offline

Posts: 1


« Reply #5 on: Saturday 27 June 2015, 07:13:56 pm »

This guide also works with eandian 3.0.5 ?
why not get it to restart , you have any advice?
Logged
mmiat
Sr. Member
****
Offline Offline

Gender: Male
Posts: 236


WWW
« Reply #6 on: Thursday 02 July 2015, 08:28:55 pm »

my script is:

Code:
#!/bin/sh
/sbin/shutdown -r now &> /dev/null
exit 0
Logged

---------------------
IT Consultant
www.fsw.it
Hardware & Software
speccompsol
Full Member
***
Offline Offline

Posts: 44


« Reply #7 on: Friday 03 July 2015, 12:05:24 pm »

Use the following and similar for scheduled reboot and/or shutdown  . . . . .

you can add a script in your /etc/anacron.monthly (substitute weekly, daily, etc for monthly) in this way:

nano /etc/anacron.monthly/reboot

Then write the following lines:

#!/bin/sh
reboot
exit 0

Change the permissions with chmod a+x /etc/anacron.monthly/reboot and you are done.
Logged
Pages: [1] Go Up Print 
« previous next »
Jump to:  

Page created in 0.088 seconds with 19 queries.
Powered by SMF 1.1 RC2 | SMF © 2001-2005, Lewis Media Design by 7dana.com