• 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 Cron Job on Fedora 34

  • 00:47 cat /etc/os-release
  • 01:05 dnf install crontabs
  • 01:46 systemctl start crond
  • 02:02 systemctl enable crond
  • 02:22 systemctl status crond
  • 02:44 crontab -e
  • 04:29 crontab -l
  • 04:37 systemctl restart crond
  • 05:00 ll
{{postValue.id}}

To Schedule A Job Using Crontab

Introduction

Cron is a system that helps Linux users to schedule any task. However, a cron job is any defined task to run in a given time period. It can be a shell script or a simple bash command. Cron job helps, us automate our routine tasks, it can be hourly, daily, monthly, etc. The cron daemon is a long-running process that executes commands at specific dates and times.

Installation Procedure

Step 1: Check the installed OS version by using the below command

[liveuser@linuxhelp ~]$ cat /etc/os-release
NAME=Fedora
VERSION="34 (Workstation Edition)"
ID=fedora
VERSION_ID=34
VERSION_CODENAME=""
PLATFORM_ID="platform:f34"

Step 2: Log in as a Root user by using the below command

[liveuser@linuxhelp ~]$ su -
Last login: Mon Oct 25 14:01:02 EDT 2021 on pts/0

Step 3: Install Crontab by using the below command

[root@linuxhelp ~]# dnf install crontabs
Fedora Modular 34 - x86_64 - Updates                                                                                                    8.9 kB/s | 6.7 kB     00:00    
Fedora Modular 34 - x86_64 - Updates                                                                                                     85 kB/s | 229 kB     00:02    
Fedora 34 - x86_64 - Updates                                                                                                            5.2 kB/s | 4.5 kB     00:00    
Fedora 34 - x86_64 - Updates                                                                                                            909 kB/s | 3.0 MB     00:03    
Fedora 34 - x86_64                                                                                                                      731 kB/s |  74 MB     01:43    

Last metadata expiration check: 0:00:01 ago on Tue 26 Oct 2021 12:18:26 PM EDT.
Dependencies resolved.
========================================================================================================================================================================
 Package                                  Architecture                     Version                                               Repository                        Size
========================================================================================================================================================================
Installing:
 crontabs                                 noarch                           1.11-24.20190603git.fc34                              fedora                            18 k
Installing dependencies:
 cronie-anacron                           x86_64                           1.5.7-1.fc34                                          fedora                            32 k
Installing weak dependencies:
 cronie                                   x86_64                           1.5.7-1.fc34                                          fedora                           116 k

Step 4: Start, Enable crontab Service by using the below command

[root@linuxhelp ~]# systemctl start crond
[root@linuxhelp ~]# systemctl enable crond

Step 5: Check the crontab status by using the below command

[root@linuxhelp ~]# systemctl status crond
● crond.service - Command Scheduler
     Loaded: loaded (/usr/lib/systemd/system/crond.service; enabled; vendor preset: enabled)
     Active: active (running) since Tue 2021-10-26 12:19:30 EDT; 45s ago
   Main PID: 65172 (crond)
      Tasks: 1 (limit: 2261)
     Memory: 1.1M
        CPU: 17ms
     CGroup: /system.slice/crond.service

             └─65172 /usr/sbin/crond –n

Step 6: Edit crontab file by using the below command

[root@linuxhelp ~]# crontab –e
NU nano 5.6.1                                                             /tmp/crontab.t8LcVZ                                                                        
26 12 * * * mkdir jpj.text
26 12 * * * touch test.file

Step 7: Check created cron file by using the below command

[root@linuxhelp ~]# crontab -l
26 12 * * * mkdir jpj.text
26 12 * * * touch test.fil

Step 8: Then restart the crontab service

root@linuxhelp ~]# systemctl restart crond

step 9: To using this command to check cron job

[root@linuxhelp ~]# ll
total 16
-rw-------. 1 root root 12139 Apr 23  2021 anaconda-ks.cfg
drwxr-xr-x. 2 root root  4096 Oct 26 12:26 jpj.text
-rw-r--r--. 1 root root     0 Oct 26 12:26 test.file

Step 10: Check the cron job working status as shown in the below images

Capture1

Capture2

Capture3

Conclusion:

We have reached the end of this article. In this guide, we have walked you through the steps required to schedule a job using crontab. Your feedback is much welcome.

Tags:
stalin
Author: 

Comments ( 0 )

No comments available

Add a comment
{{postCtrl.cmtErrMsg}}

Frequently asked questions ( 5 )

Q

What is cron used for?

A

Cron is a standard Unix utility that schedules commands for automatic execution at specific intervals.

Q

How does a cron job work?

A

Cron Jobs allow you to automate specific commands or scripts on your server to complete repetitive tasks automatically.

Q

What is the cron job schedule?

A

Cron jobs are scheduled at recurring intervals, specified using unix-cron format

Q

How do I list all cron jobs?

A

In Fedora you can view crontab by using this command (crontab -l)

Q

How to Remove a crontab File

A

Remove the crontab file. $ crontab -r [ username ] where username specifies the name of the user's account for which you want to remove a crontab file.

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 Jayce ?
What are the types of table used in IPtables

What are the various types of table used in IPtables and how to use that for my server security?

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.