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

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 :: how to zip my files without ds_store 
Shell :: test if file is executable bash 
Shell :: scheduler ubuntu cmd 
Shell :: vim code highlighting mac 
Shell :: fix read only file system 
Shell :: fetch all git branches 
Shell :: linux commad to show directories 
Shell :: git merge vs git merge --no-ff 
Shell :: pip upgrade all at once 
Shell :: apt list only security updates 
Shell :: How To Print The Username Of PC User On Batch Script 
Shell :: kill force linux 
Shell :: -bash: bin/startup.sh: Permission denied 
Shell :: kubectl exec bash 
Shell :: githu copilot 
Shell :: $() vs `` bash 
Shell :: change ubuntu terminal prompt color 
Shell :: get total installed List from ubuntu terminal 
Shell :: set java home path 
Shell :: github create branch from issue 
Shell :: Installing ipython-sql in Jupyter 
Shell :: ubuntu permission all file in folder 
Shell :: export docker container 
Shell :: cluster_block_exception 
Shell :: install wordpress ubuntu 20.04 
Shell :: install npm colors 
Shell :: install discord on fedora 
Shell :: tcpdump filter ip address 
Shell :: Installed Build Tools revision 32.0.0 is corrupted. Remove and install again using the SDK Manager 
Shell :: bash colour codes 
ADD CONTENT
Topic
Content
Source link
Name
4+2 =