Solved

run "crontab -e" without terminal

Posted on 2001-09-12
5
453 Views
Last Modified: 2008-02-01
Hi!

I have a linux-box, where I only have ftp-access and procmail!

I want to install a cron-job.
The only way how I can run jobs with my user-id is IMHO procmail!

for this I would need a solution how to make something like:

vi < input.txt

input.txt:
---
iTEST^[:wOUT1
:q                                                                                                            

---

this doesn't work because vi wants a terminal - any ideas??

thanks
witty
0
Comment
Question by:witty
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
5 Comments
 
LVL 51

Expert Comment

by:ahoffmann
ID: 6477590
echo TEST > OUT1
0
 
LVL 1

Author Comment

by:witty
ID: 6478644
but I don't want to write to a file, but to "crontab"!
"crontab -e" opens an editor!

echo TEST | crontab -e
or
cat file | crontab -e
or
crontab -e < file

don't work:
Vim: Warning: Input is not from a terminal

witty
0
 
LVL 8

Accepted Solution

by:
mnashadka earned 150 total points
ID: 6479125
echo "* * * * * iTEST > OUT1" > cron_file
crontab cron_file

Hope this helps.
0
 
LVL 4

Expert Comment

by:garisoain
ID: 6481362
Hey there,

if you want to edit your crontab via command line, you must use redirection, and filters.
example to add a line:
cp /var/spool/cron/crontabs/<user> temp-cron
echo "Crontab entry" >> temp_cron
crontab temp_cron

example to delete a line containing a command called "wakeup":
cp /var/spool/cron/crontabs/<user> temp-cron
grep -v wakeup temp-cron > temp-cron
crontab temp_cron

example to substitute a command called "one" with another command called "two":
cp /var/spool/cron/crontabs/<user> temp-cron
sed s/one/two/g temp-cron > temp-cron
crontab temp_cron

Remember that <user> stands for the user you're using.

hope this helps...-garisoain
0
 
LVL 1

Author Comment

by:witty
ID: 6481658
mnashadka and garisoain:

thanks for your comment - oops I didn't know, you can run "crontab <file>"
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Linux Hosting 16 80
fedora linux on laptop - setup sendmail - or some kind of email 5 66
centos commands 6 93
Can't "Unset" Proxy in Apache headers for PCI compliance... 4 44
Using 'screen' for session sharing, The Simple Edition Step 1: user starts session with command: screen Step 2: other user (logged in with same user account) connects with command: screen -x Done. Both users are connected to the same CLI sessio…
SSH (Secure Shell) - Tips and Tricks As you all know SSH(Secure Shell) is a network protocol, which we use to access/transfer files securely between two networked devices. SSH was actually designed as a replacement for insecure protocols that sen…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

726 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question