#!/bin/bash # Function to clean all crontab crontabClean() { # Remove old backup log entries data_to_remove=" >> ${logs_dir}${backup_log_file} 2>&1" if crontab -l 2>/dev/null | grep -q "$data_to_remove"; then crontab -l 2>/dev/null | sed "s|$data_to_remove||g" | crontab - isSuccessful "Removed old data from crontab entries." fi }