Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

488
Vistas
How can I remove the particular line in crontab?

below mentioned script has my crontab running functions.

# Chef Name: binary_log_purge 0 */4 * * * /engineyard/bin/binary_log_purge -q
# Chef Name: database_oom_score
*/30 * * * * /engineyard/bin/database_oom_adj
# Chef Name: logrotate -f /etc/logrotate.d/stats 0 * * * * logrotate -f /etc/logrotate.d/stats
# Chef Name: cpu_utilaisation
*/5 * * * * cd /tmp && sh cpu_util.sh >> cpu_utilaisation.log
# Chef Name: Test_script
*/2 * * * * cd /tmp && sh test.sh >> tests_cript.log

The above mentioned query i want to remove the blow line

# Chef Name: Test_script
*/2 * * * * cd /tmp && sh test.sh >> tests_cript.log

How can i remove the function with below mentioned steps:

Step 1 : first i want to find the below line is there or not. How can i find out?

*/2 * * * * cd /tmp && sh test.sh >> tests_cript.log

Step 2 : If the line is there. I want to remove the function. How can i remove the function ?

Please help me.....

over 4 years ago · Santiago Trujillo
2 Respuestas
Responde la pregunta

0

According to man 5 crontab the crontab files are not intended to be edited directly.

What you can do is run crontab -l, filter out the line using grep -v, run crontab -r to clear the crontab then pipe the modified version of the crontab file into crontab -.

over 4 years ago · Santiago Trujillo Denunciar

0

You can use grep -A 1 'Chef Name: Test_script' | grep -v "^#" to get the line after Test_script but ignoring commented out lines.

over 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda