Cron running script to check line for a comment
Clash Royale CLAN TAG#URR8PPP
up vote
0
down vote
favorite
WE are running plesk on Centos 7 and need to check this config file every 5 minutes to make sure that line x is commented out as plesk keeps un commenting it.
We would run this under cron every 5 minutes...
the file path is
/etc/proftpd.d/50-plesk.conf
the line we wish to make sure is always commented is...
MasqueradeAddress 37.***.4***.60
-----------------------------------
#ATTENTION!
#
#DO NOT MODIFY THIS FILE BECAUSE IT WAS GENERATED AUTOMATICALLY,
#SO ALL YOUR CHANGES WILL BE LOST THE NEXT TIME THE FILE IS GENERATED.
# Global section
<Global>
<IfModule mod_tls.c>
TLSEngine on
TLSRequired off
</IfModule>
</Global>
# Global section
<VirtualHost 10.***.***.195>
#MasqueradeAddress 37.***.4***.60
scripting cron
add a comment |Â
up vote
0
down vote
favorite
WE are running plesk on Centos 7 and need to check this config file every 5 minutes to make sure that line x is commented out as plesk keeps un commenting it.
We would run this under cron every 5 minutes...
the file path is
/etc/proftpd.d/50-plesk.conf
the line we wish to make sure is always commented is...
MasqueradeAddress 37.***.4***.60
-----------------------------------
#ATTENTION!
#
#DO NOT MODIFY THIS FILE BECAUSE IT WAS GENERATED AUTOMATICALLY,
#SO ALL YOUR CHANGES WILL BE LOST THE NEXT TIME THE FILE IS GENERATED.
# Global section
<Global>
<IfModule mod_tls.c>
TLSEngine on
TLSRequired off
</IfModule>
</Global>
# Global section
<VirtualHost 10.***.***.195>
#MasqueradeAddress 37.***.4***.60
scripting cron
3
You should find out why plesk keeps adding the line and fix that.
â RalfFriedl
Aug 15 at 10:20
2
If you discover the line uncommented, would you also have to restart any services that might now be running âÂÂincorrectlyâÂÂ?
â Jeff Schaller
Aug 15 at 10:40
Here is a possible answer about searching and replacing things inside a file, but as @RalfFriedl suggested you should find what is doing this in the first place. askubuntu.com/questions/20414/â¦
â Mehmet
Aug 15 at 11:05
Thanks, Plesk support say that there is no way around this and this is the only way.....
â SnowPlough
Aug 15 at 11:16
add a comment |Â
up vote
0
down vote
favorite
up vote
0
down vote
favorite
WE are running plesk on Centos 7 and need to check this config file every 5 minutes to make sure that line x is commented out as plesk keeps un commenting it.
We would run this under cron every 5 minutes...
the file path is
/etc/proftpd.d/50-plesk.conf
the line we wish to make sure is always commented is...
MasqueradeAddress 37.***.4***.60
-----------------------------------
#ATTENTION!
#
#DO NOT MODIFY THIS FILE BECAUSE IT WAS GENERATED AUTOMATICALLY,
#SO ALL YOUR CHANGES WILL BE LOST THE NEXT TIME THE FILE IS GENERATED.
# Global section
<Global>
<IfModule mod_tls.c>
TLSEngine on
TLSRequired off
</IfModule>
</Global>
# Global section
<VirtualHost 10.***.***.195>
#MasqueradeAddress 37.***.4***.60
scripting cron
WE are running plesk on Centos 7 and need to check this config file every 5 minutes to make sure that line x is commented out as plesk keeps un commenting it.
We would run this under cron every 5 minutes...
the file path is
/etc/proftpd.d/50-plesk.conf
the line we wish to make sure is always commented is...
MasqueradeAddress 37.***.4***.60
-----------------------------------
#ATTENTION!
#
#DO NOT MODIFY THIS FILE BECAUSE IT WAS GENERATED AUTOMATICALLY,
#SO ALL YOUR CHANGES WILL BE LOST THE NEXT TIME THE FILE IS GENERATED.
# Global section
<Global>
<IfModule mod_tls.c>
TLSEngine on
TLSRequired off
</IfModule>
</Global>
# Global section
<VirtualHost 10.***.***.195>
#MasqueradeAddress 37.***.4***.60
scripting cron
scripting cron
edited Aug 15 at 11:50
Rui F Ribeiro
36.7k1271116
36.7k1271116
asked Aug 15 at 10:14
SnowPlough
6
6
3
You should find out why plesk keeps adding the line and fix that.
â RalfFriedl
Aug 15 at 10:20
2
If you discover the line uncommented, would you also have to restart any services that might now be running âÂÂincorrectlyâÂÂ?
â Jeff Schaller
Aug 15 at 10:40
Here is a possible answer about searching and replacing things inside a file, but as @RalfFriedl suggested you should find what is doing this in the first place. askubuntu.com/questions/20414/â¦
â Mehmet
Aug 15 at 11:05
Thanks, Plesk support say that there is no way around this and this is the only way.....
â SnowPlough
Aug 15 at 11:16
add a comment |Â
3
You should find out why plesk keeps adding the line and fix that.
â RalfFriedl
Aug 15 at 10:20
2
If you discover the line uncommented, would you also have to restart any services that might now be running âÂÂincorrectlyâÂÂ?
â Jeff Schaller
Aug 15 at 10:40
Here is a possible answer about searching and replacing things inside a file, but as @RalfFriedl suggested you should find what is doing this in the first place. askubuntu.com/questions/20414/â¦
â Mehmet
Aug 15 at 11:05
Thanks, Plesk support say that there is no way around this and this is the only way.....
â SnowPlough
Aug 15 at 11:16
3
3
You should find out why plesk keeps adding the line and fix that.
â RalfFriedl
Aug 15 at 10:20
You should find out why plesk keeps adding the line and fix that.
â RalfFriedl
Aug 15 at 10:20
2
2
If you discover the line uncommented, would you also have to restart any services that might now be running âÂÂincorrectlyâÂÂ?
â Jeff Schaller
Aug 15 at 10:40
If you discover the line uncommented, would you also have to restart any services that might now be running âÂÂincorrectlyâÂÂ?
â Jeff Schaller
Aug 15 at 10:40
Here is a possible answer about searching and replacing things inside a file, but as @RalfFriedl suggested you should find what is doing this in the first place. askubuntu.com/questions/20414/â¦
â Mehmet
Aug 15 at 11:05
Here is a possible answer about searching and replacing things inside a file, but as @RalfFriedl suggested you should find what is doing this in the first place. askubuntu.com/questions/20414/â¦
â Mehmet
Aug 15 at 11:05
Thanks, Plesk support say that there is no way around this and this is the only way.....
â SnowPlough
Aug 15 at 11:16
Thanks, Plesk support say that there is no way around this and this is the only way.....
â SnowPlough
Aug 15 at 11:16
add a comment |Â
1 Answer
1
active
oldest
votes
up vote
0
down vote
Instead of a cron job, as a short time measure, tell the OS to write protect that file.
Do:
sudo chattr +i /etc/proftpd.d/50-plesk.conf
Obviously, as the comments rightfully tell you, the duty of Plesk Support would be to tell you how to solve that, or give you a software fix.
add a comment |Â
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
0
down vote
Instead of a cron job, as a short time measure, tell the OS to write protect that file.
Do:
sudo chattr +i /etc/proftpd.d/50-plesk.conf
Obviously, as the comments rightfully tell you, the duty of Plesk Support would be to tell you how to solve that, or give you a software fix.
add a comment |Â
up vote
0
down vote
Instead of a cron job, as a short time measure, tell the OS to write protect that file.
Do:
sudo chattr +i /etc/proftpd.d/50-plesk.conf
Obviously, as the comments rightfully tell you, the duty of Plesk Support would be to tell you how to solve that, or give you a software fix.
add a comment |Â
up vote
0
down vote
up vote
0
down vote
Instead of a cron job, as a short time measure, tell the OS to write protect that file.
Do:
sudo chattr +i /etc/proftpd.d/50-plesk.conf
Obviously, as the comments rightfully tell you, the duty of Plesk Support would be to tell you how to solve that, or give you a software fix.
Instead of a cron job, as a short time measure, tell the OS to write protect that file.
Do:
sudo chattr +i /etc/proftpd.d/50-plesk.conf
Obviously, as the comments rightfully tell you, the duty of Plesk Support would be to tell you how to solve that, or give you a software fix.
answered Aug 15 at 11:49
Rui F Ribeiro
36.7k1271116
36.7k1271116
add a comment |Â
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f462717%2fcron-running-script-to-check-line-for-a-comment%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
3
You should find out why plesk keeps adding the line and fix that.
â RalfFriedl
Aug 15 at 10:20
2
If you discover the line uncommented, would you also have to restart any services that might now be running âÂÂincorrectlyâÂÂ?
â Jeff Schaller
Aug 15 at 10:40
Here is a possible answer about searching and replacing things inside a file, but as @RalfFriedl suggested you should find what is doing this in the first place. askubuntu.com/questions/20414/â¦
â Mehmet
Aug 15 at 11:05
Thanks, Plesk support say that there is no way around this and this is the only way.....
â SnowPlough
Aug 15 at 11:16