Unix 2022-08-11 22:48

|
armanhrshaikh 2022-08-11 22:48:19
marcotrosi 2022-08-11 21:21:34
as crontab -e opens vim you can load the file from there, and create a command or mapping that does that automatically

Ok

BytesIO 2022-08-11 22:48:25
marcotrosi 2022-08-11 22:46:50
that’s a nice example actually, and I think I should update my tutorial which I linked

cool, I was preparing a for an exam. the questions asked are related to C

BytesIO 2022-08-11 22:48:49
due to the fact I nvr used C, these behaviors are unfamiliar.
BytesIO 2022-08-11 22:48:57
thanks again for the help
armanhrshaikh 2022-08-11 22:49:32
Fibonakki 2022-08-11 21:23:26
But if he smh needs to automate this for several servers or idk maybe he needs to update the crontabs daily for whatever reason then…

I wanna distribute to non tech people for automation , thats why I was looking for better solution

armanhrshaikh 2022-08-11 22:52:08
marcotrosi 2022-08-11 21:29:08
command ReadCronJobs 1,$d|0read mycronjobs.txt

assuming you want to overwrite your complete crontab file

and then

:ReadCronJobs

Append

marcotrosi 2022-08-11 23:03:36
armanhrshaikh 2022-08-11 22:52:08
Append

if you want to append only then change it to

command ReadCronJobs $read mycronjobs.txt

armanhrshaikh 2022-08-11 23:07:25
marcotrosi 2022-08-11 23:03:36
if you want to append only then change it to

command ReadCronJobs $read mycronjobs.txt

Not clear

armanhrshaikh 2022-08-11 23:07:41
marcotrosi 2022-08-11 21:29:08
command ReadCronJobs 1,$d|0read mycronjobs.txt

assuming you want to overwrite your complete crontab file

and then

:ReadCronJobs

What’s is this

marcotrosi 2022-08-11 23:08:36
oh I’m suddenly so tired I need to sleep
Fibonakki 2022-08-11 23:09:05
marcotrosi 2022-08-11 23:08:36
oh I’m suddenly so tired I need to sleep

I will take it from here)

marcotrosi 2022-08-11 23:09:13
thx
marcotrosi 2022-08-11 23:09:30
or I’ll explain him tomorrow
Fibonakki 2022-08-11 23:10:16
I will give it a shot. You already said everything needed. All i can add is if what Marco said doesn’t work for you @armanhrshaikh then just directly edit the crontabs
armanhrshaikh 2022-08-11 23:10:40
@marcotrosi Fibonakki I will share you my git repo so you can understand my project
Fibonakki 2022-08-11 23:10:41
unixusergroup-48974.jpg

Fibonakki 2022-08-11 23:11:57
Please go to /var/spool/cron/crontabs/<userid>
Fibonakki 2022-08-11 23:14:36
Wait you might just be able to pipe it
Fibonakki 2022-08-11 23:15:14
Can you try: cat file.txt | crontab -e ?
armanhrshaikh 2022-08-11 23:15:28
Fibonakki 2022-08-11 23:10:41

)I think, I told you about my project,
It’s for termux

armanhrshaikh 2022-08-11 23:15:37
https://github.com/armanhrshaikh/sms_automation.git
Fibonakki 2022-08-11 23:15:52
Fibonakki 2022-08-11 23:15:14
Can you try: cat file.txt | crontab -e ?

Nvmd this doesn’t work

armanhrshaikh 2022-08-11 23:16:10
Fibonakki 2022-08-11 23:15:52
Nvmd this doesn’t work

I did that few hours ago

marcotrosi 2022-08-11 23:16:36
marcotrosi 2022-08-11 21:21:34
as crontab -e opens vim you can load the file from there, and create a command or mapping that does that automatically

@armanhrshaikh have you read this message?

armanhrshaikh 2022-08-11 23:16:58
Fibonakki 2022-08-11 23:10:41

I read this and 4 different articles.

marcotrosi 2022-08-11 23:17:06
marcotrosi 2022-08-11 21:29:08
command ReadCronJobs 1,$d|0read mycronjobs.txt

assuming you want to overwrite your complete crontab file

and then

:ReadCronJobs

@armanhrshaikh and that’s the Vim command I created for you

Fibonakki 2022-08-11 23:17:16
Hey it worked this way as well i think. Try this
armanhrshaikh 2022-08-11 23:17:25
marcotrosi 2022-08-11 23:16:36
@armanhrshaikh have you read this message?

Yeah and I said, if I met non technical

armanhrshaikh 2022-08-11 23:17:50
That solution I can go with
marcotrosi 2022-08-11 23:17:51
good
armanhrshaikh 2022-08-11 23:18:23
But being a Unix group member, I was expecting something epic
marcotrosi 2022-08-11 23:18:49
expectations only lead to disappointment
armanhrshaikh 2022-08-11 23:18:59
I just wanna make project easy and one click solution for sms automation
armanhrshaikh 2022-08-11 23:19:15
marcotrosi 2022-08-11 23:18:49
expectations only lead to disappointment

Fortune 🔮

marcotrosi 2022-08-11 23:19:37
armanhrshaikh 2022-08-11 23:18:59
I just wanna make project easy and one click solution for sms automation

what you really should do is work a bit harder on finding the solutions yourself

|