task : write a script in Linux that every quarter of every hour generates a Test directory with a Test file

tibi

New Member
Joined
Jan 26, 2023
Messages
5
Reaction score
0
Credits
34
Hello,
I've just started a new job, it's my first contact with Linux and I have this task, for learning.
So far I've learn that command line 15 * * * * -in crontab, schedule the script, but I have problems with the command lines from script

#!/bin/sh
mkdir /Test
touch /Test/Test.txt

15 * * * * /Test/Test.txt

any suggestion?
 


MattWinter

Active Member
Joined
Dec 5, 2022
Messages
172
Reaction score
216
Credits
1,273
Well, first it looks like you aren't calling crontab. I can't tell by your listing whether that crontab command is in the script or not, and the crontab command itself needs something to execute. What is your script called?
Also, I would suggest going over this article by one of our members:
How to ask a Good Support Question
 

dos2unix

Well-Known Member
Joined
May 3, 2019
Messages
1,916
Reaction score
1,515
Credits
13,184
15 * * * * /Test/Test.txt

The syntax of your crontab is incorrect. You probably want something like...

*/15 * * * *
 

dos2unix

Well-Known Member
Joined
May 3, 2019
Messages
1,916
Reaction score
1,515
Credits
13,184
What are the permissions on "Test"? Who owns this directory?
Does your script run manually? ( without cron )
 

Members online


Top