Search
 
SCRIPT & CODE EXAMPLE
 

SHELL

how to edit crontab in linux

Step 1 : crontab -e
Step 2 : Select your prefered editor for the file.
Steo 3 : Add the command that you want to execute from cron and save that file.
		Example : 1 0 * * 0 rm /home/jones/*.log > /dev/null 2>&1
Step 4 : check if cron is activate using command
		crontab -l
Comment

How to change default crontab editor

export EDITOR=/bin/nano
export VISUAL=nano
Comment

edit crontab daily

crontab -e
@monthly root /usr/bin/ntpdate > /dev/null 2>&1
service crond restart
Comment

change crontab editor

#run command in terminal:
select-editor

#Then select an option:
Select an editor.  To change later, run 'select-editor'.
  1. /bin/nano        <---- easiest
  2. /usr/bin/vim.tiny
  3. /bin/ed

Choose 1-3 [1]:
Comment

crontab edit

crontab -e		# open user crontab in edit mode
i      			# for insert.  Make your changes
:wq!   			# quit and save
crontab -l		# open user crontab in read mode
Comment

edit crontab daily

grep -R cron /etc
Comment

edit crontab daily

Newer versions use /etc/anacrontab. By default, cron.daily scripts are run at 4:02. Editing /etc/crontab will modify that time.

# run-parts
01 * * * * root run-parts /etc/cron.hourly
02 4 * * * root run-parts /etc/cron.daily
22 4 * * 0 root run-parts /etc/cron.weekly
42 4 1 * * root run-parts /etc/cron.monthly
Comment

PREVIOUS NEXT
Code Example
Shell :: git create a new branch from current branch 
Shell :: how to upgrade to wsl 2 
Shell :: conda install pandas 
Shell :: install openssl ubuntu 
Shell :: npm install package as dependecy 
Shell :: install kazam screencaster ubuntu 
Shell :: clock skew detected github 
Shell :: lock symbol on files in ubuntu 
Shell :: raspberry pi connect to wifi via terminal 
Shell :: change time linux 
Shell :: nano line number 
Shell :: chmod just directories 
Shell :: docker system prune 
Shell :: how to merge branch to master 
Shell :: grep lines between two patterns in unix 
Shell :: wslconfig example 
Shell :: jupyter install not running on windows 
Shell :: how to go back to last git commit 
Shell :: uninstall npm package 
Shell :: delete a github repository using bash 
Shell :: how to generate ssh key 
Shell :: push particular commit in git 
Shell :: bash loading bar spinner in bash shell script 
Shell :: configure apache in ubuntu 
Shell :: To see details about a wifi connection on linux 
Shell :: git history 
Shell :: how to make directory in ubantu 
Shell :: get current working directory ubuntu 
Shell :: git move branch to previous commit 
Shell :: git clone permission denied 
ADD CONTENT
Topic
Content
Source link
Name
6+4 =