I just curious of a process in my office. I should change a rule in squid for just 30 minutes. But I have not find anything that related to it. I know squid can arrange some time to run some rule. But what I mean here is the change is accidentally occur. Squid timer is defined.
Example :
acl blokir dstdomain “/etc/squid/blokir.txt”
acl waktu time MTWHFAS 07:00 – 08:00
http_access deny localnet blokir waktu
That mean, squid will run blokir command to block something from monday through sunday at 07:00 til 08:00. Squid will not blocking from 08:00 through 09:00 for example.
So i search in google and found at command here.
Here what it use
$at 0701
0701 means at 07:01 o’clock.
The screen will change to > and there is a warning said all the command will be execute with /bin/sh
>/home/user/myscript
>
Press ctrl+D. The at command wills ave the script.
Here is the example of my script
#!/bin/bash
echo “my script”
at command will execute script that run echo command at 07:01 am.
at will memorize each job with number. To see the list
$at -l
To remove it
$at 3
Mean job number 3
In Ubuntu or any linux, sometime root privilege is important when connecting to root specific command. So do at command in root privilege.
In ubuntu
$sudo at 0700
in slackware
root@user$at 0700
That’s it, this command is useful for me.
Leave a Reply