LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Closed Thread
  Search this Thread
Old 09-12-2018, 06:02 AM   #1
sumakn
LQ Newbie
 
Registered: Sep 2018
Posts: 3

Rep: Reputation: Disabled
How to schedule a bash command (not a script) in crontab


I need to schedule a specific command to run once at a specific time during the day under /etc/cron.d. I am familiar with scheduling scripts. But is it possible to schedule a command directly (ex: sudo apt-get clean) instead of putting it in a script?
 
Old 09-12-2018, 06:07 AM   #2
jsbjsb001
Senior Member
 
Registered: Mar 2009
Location: Earth, unfortunately...
Distribution: Currently: OpenMandriva. Previously: openSUSE, PCLinuxOS, CentOS, among others over the years.
Posts: 3,881

Rep: Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063
Quote:
Originally Posted by sumakn View Post
I need to schedule a specific command to run once at a specific time during the day under /etc/cron.d. I am familiar with scheduling scripts. But is it possible to schedule a command directly (ex: sudo apt-get clean) instead of putting it in a script?
First of all, have you done any research about this before asking here?

Second, this looks like a dupe of this: https://www.linuxquestions.org/quest...ab-4175638226/

I've reported this thread for closure.
 
1 members found this post helpful.
Old 09-12-2018, 07:28 AM   #3
rtmistler
Moderator
 
Registered: Mar 2011
Location: USA
Distribution: MINT Debian, Angstrom, SUSE, Ubuntu, Debian
Posts: 9,876
Blog Entries: 13

Rep: Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930
Please post your thread in only one forum. Posting a single thread in the most relevant forum will make it easier for members to help you and will keep the discussion in one place. This thread is being closed because it is a duplicate.
 
  


Closed Thread


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to schedule a bash command (not a script) in crontab sumakn Linux - Newbie 7 09-12-2018 07:14 AM
[SOLVED] bash script works from command line but not crontab? stockton Programming 19 12-30-2016 01:40 PM
In crontab, how can I schedule a command for every x months or every other DOW charlemagne-is-my-son Linux - Software 1 12-06-2014 10:53 PM
Using crontab to schedule a script stuball Linux - Server 9 05-19-2009 07:39 AM
Schedule TOP command in Crontab. imsajjadali Red Hat 2 05-20-2004 04:12 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 11:22 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration