• Categories
    Category
    {{ postCtrl.tags }}
    • {{ category.tag_type }}

      • {{tag.tag_name}}
      • View more
  • Categories
    Category
    {{ postCtrl.tags }}
    • {{ category.tag_type }}

      • {{tag.tag_name}}
      • View more
  • News
  • Tutorials
  • Forums
  • Tags
  • Users
Tutorial News Comments FAQ Related Articles

How To Schedule a Cron Job to run Scripts in Debian 11.3

  • 00:25 lsb_release -a
  • 00:36 systemctl status cron
  • 01:08 vim test.sh
  • 02:16 chmod u+x test.sh
  • 02:23 crontab -e
  • 03:23 cd /home/linuxhelp/
  • 03:34 ls
  • 03:45 ls -la
  • 04:04 crontab -l
  • 04:15 crontab -r
{{postValue.id}}

To Schedule a Cron Job to run Scripts in Debian 11.3

Introduction:

Scheduling a Job for a Specific Time The basic usage of cron is to execute a job in a specific time The cron daemon is a long-running process that executes commands at specific dates and times. You can use this to schedule activities, either as one-time events or as recurring tasks

Installation Steps:

Step1: Check the OS Version of Debian by using the below command

[root@linuxhelp ]# lsb_release -a

PRETTY_NAME="Debian GNU/Linux 11 (bullseye)"
NAME="Debian GNU/Linux"
VERSION_ID="11"
VERSION="11 (bullseye)"
VERSION_CODENAME=bullseye

Step 2: Create a file “ test.sh” by using the below command

[root@linuxhelp linuxhelp]# vim test.sh
touch /home/linuxhelp/Downloads/file1.txt
mkdir /home/linuxhelp/Downloads/folder

Step 3: Grant Permission by using the below command.

[root@linuxhelp linuxhelp]# chmod u+x test.sh

Step 4: Assign a cron job and run the below command.

[root@linuxhelp]# crontab -e
45 01 18 Jun * /home/linuxhelp/Downloads/test.sh

Step 5: Change Directory by using the below command

[root@ linuxhelp]# cd /home/linuxhelp/
[root@ linuxhelp :home/linuxhelp/ ]# cd Downloads

Step 6: List the Directory at 01:45 AM by using the below command, The Scheduled job to create file and Directory will be created as shown in the below image

[root@ linuxhelp :home/linuxhelp/ cd Downloads]# ls -la

snap 1

Step 7: To List the Scheduled jobs use the below command.

[root@linuxhelp]# crontab -l
45 01 18 Jun * /home/linuxhelp/Downloads/test.sh

Step 8: To Remove the Scheduled jobs use the below command.

[root@linuxhelp]# crontab -r

Conclusion:

We have reached the end of this article. In this guide, we have walked you through the steps required to Schedule a Cron Job to run Scripts in Debian 11.3. Your feedback is much welcome.

Tags:
connor
Author: 

Comments ( 0 )

No comments available

Add a comment
{{postCtrl.cmtErrMsg}}

Frequently asked questions ( 5 )

Q

How to Create or Edit a crontab File?

A

Create a new crontab file, or edit an existing file using the command $ crontab -e [username] .

Q

What is the use of * * * * * In cron?

A

It is a wildcard for every part of the cron schedule expression. So * * * * * means every minute of every hour of every day of every month and every day of the week

Q

Can cron run multiple commands at the same time?

A

We can run several commands in the same cron job by separating them with a semi-colon (;)

Q

How many cron jobs is too many?

A

The cron daemon has a limit of how many jobs it will run simultaneously. By default it is 100 jobs

Q

Where are crontab logs stored?

A

Logs are Stored in /var/log/cron

Back To Top!
Rank
User
Points

Top Contributers

userNamenaveelansari
135850

Top Contributers

userNameayanbhatti
92510

Top Contributers

userNamehamzaahmed
32150

Top Contributers

1
userNamelinuxhelp
31040

Top Contributers

userNamemuhammadali
24500
Can you help Luke ?
workbench for debian

I am using workbench in CentOS whereas now I need to use Debian Operating system so could you please help to install and use in Debian?

Networking
  • Routing
  • trunk
  • Netmask
  • Packet Capture
  • domain
  • HTTP Proxy
Server Setup
  • NFS
  • KVM
  • Memory
  • Sendmail
  • WebDAV
  • LXC
Shell Commands
  • Cloud commander
  • Command line archive tools
  • last command
  • Shell
  • terminal
  • Throttle
Desktop Application
  • Linux app
  • Pithos
  • Retrospect
  • Scribe
  • TortoiseHg
  • 4Images
Monitoring Tool
  • Monit
  • Apache Server Monitoring
  • EtherApe 
  • Arpwatch Tool
  • Auditd
  • Barman
Web Application
  • Nutch
  • Amazon VPC
  • FarmWarDeployer
  • Rukovoditel
  • Mirror site
  • Chef
Contact Us | Terms of Use| Privacy Policy| Disclaimer
© 2025 LinuxHelp.com All rights reserved. Linux™ is the registered trademark of Linus Torvalds. This site is not affiliated with linus torvalds in any way.