Page 1 of 2 12 LastLast
Results 1 to 10 of 15

Thread: how to save crontab file or creat it by gedit?

  1. #1
    Join Date
    Oct 2013
    Posts
    25

    Default how to save crontab file or creat it by gedit?

    hi
    i'm beginner in linux!
    i need to crontab, so i use
    Code:
    crontab -e
    and type my code:
    Code:
    10 10 * * * idle3
    but i cann't save it!!! i try keyboard shortcuts and .... but cann't save anything! how i can save a crontab file or use gedit to creat crontab files (edit in gedit and enable it as crontab)?
    tank you

  2. #2
    Join Date
    Aug 2010
    Location
    Chicago suburbs
    Posts
    12,890
    Blog Entries
    3

    Default Re: how to save crontab file or creat it by gedit?

    Quote Originally Posted by mshj View Post
    but i cann't save it!!! i try keyboard shortcuts and .... but cann't save anything! how i can save a crontab file or use gedit to creat crontab files (edit in gedit and enable it as crontab)?
    tank you
    Probably, if you use:

    Code:
    EDITOR=/usr/bin/gedit crontab -e
    that would allow you to edit with "gedit".
    openSUSE Leap 15.1; KDE Plasma 5;
    testing Leap 15.2Alpha

  3. #3
    Join Date
    Oct 2013
    Posts
    25

    Default Re: how to save crontab file or creat it by gedit?

    thank you

  4. #4

    Default Re: how to save crontab file or creat it by gedit?

    Regarding the default editor, which is vim:
    Press the key 'i' to enter insert mode, you can then change the file similar like you would with any other editor.
    Afterwards press ESC to leave insert mode again, and type ":wq" to save and quit.

    Vim comes with help, type ":help" to see it.

    Or see here for an interactive online tutorial:
    http://www.openvim.com/tutorial.html

  5. #5

    Default Re: how to save crontab file or creat it by gedit?

    for a single user see

    Code:
    head -n 17 ~/.bashrc
    for system_wide/global change see

    Code:
    head -n8 /etc/bash.bashrc.local
    Note that .local needs to be created
    "Unfortunately time is always against us" -- [Morpheus]

    .:https://github.com/Jetchisel:.

  6. #6
    Join Date
    Jun 2008
    Location
    Netherlands
    Posts
    25,394

    Default Re: how to save crontab file or creat it by gedit?

    Quote Originally Posted by mshj View Post
    hi
    i'm beginner in linux!
    i need to crontab, so i use
    Code:
    crontab -e
    and type my code:
    Code:
    10 10 * * * idle3
    but i cann't save it!!! i try keyboard shortcuts and .... but cann't save anything! how i can save a crontab file or use gedit to creat crontab files (edit in gedit and enable it as crontab)?
    tank you
    Did you read the man page of crontab?
    Code:
    man 1 crontab
    There you will see that the -l option will list your crontab. And thus something like
    Code:
    crontab -l >my-saved-crontab
    will save it.
    Henk van Velden

  7. #7
    Join Date
    Feb 2009
    Location
    Spain
    Posts
    25,547

    Default Re: how to save crontab file or creat it by gedit?

    On 2014-06-28 15:56, mshj wrote:

    > but i cann't save it!!! i try keyboard shortcuts and .... but cann't
    > save anything! how i can save a crontab file


    LOL.

    That's because the default editor in Linux/Unix is 'vi', and it almost
    baffles every new user that bumps into it. When I found it the first
    time, I had to reboot to get out.

    You can change the default editor. You can edit or create
    "/root/.bashrc" with one of these lines:

    Code:
    Telcontar:~ # cat .bashrc
    #export EDITOR=/usr/bin/mcedit
    export EDITOR=/usr/bin/jstar
    Telcontar:~ #
    Those two are simple text editors. mceditor is probably easier, but not
    installed by default: you need install 'mc' (which is a very useful
    program, anyway).

    --
    Cheers / Saludos,

    Carlos E. R.
    (from 13.1 x86_64 "Bottle" at Telcontar)

  8. #8
    Join Date
    Feb 2009
    Location
    Spain
    Posts
    25,547

    Default Re: how to save crontab file or creat it by gedit?

    On 2014-06-28 17:06, hcvv wrote:
    > will save it.


    He, he refers to "file save" from inside the editor you get when running
    "crontab -e", which is "vi" on default installs. Ok, maybe "vim", but in
    vi mode, so there is no help or hint about what to do. My, I still
    remember the first time I bumped into it...

    --
    Cheers / Saludos,

    Carlos E. R.
    (from 13.1 x86_64 "Bottle" at Telcontar)

  9. #9
    Join Date
    Jun 2008
    Location
    Netherlands
    Posts
    25,394

    Default Re: how to save crontab file or creat it by gedit?

    Quote Originally Posted by robin_listas View Post
    On 2014-06-28 17:06, hcvv wrote:
    > will save it.


    He, he refers to "file save" from inside the editor you get when running
    "crontab -e", which is "vi" on default installs. Ok, maybe "vim", but in
    vi mode, so there is no help or hint about what to do. My, I still
    remember the first time I bumped into it...

    --
    Cheers / Saludos,

    Carlos E. R.
    (from 13.1 x86_64 "Bottle" at Telcontar)
    Yes, I interpreted it completely wrong. As regular vi user, it did not come to my mind that writing
    the file (and probably quiting vi) was what he was looking after.

    Btw I wonder how he got into insert mode to type the line? When you never used vi, all is magic......

    Anyhow, the ans=swer should have been: type
    Code:
    :wq
    this will show from the moment you type the : (meaning enter command) in the lower left corner of the terminal and wq will write the file and quit from vi.
    Henk van Velden

  10. #10

    Default Re: how to save crontab file or creat it by gedit?

    Quote Originally Posted by jetchisel View Post
    for a single user see

    Code:
    head -n 17 ~/.bashrc
    for system_wide/global change see

    Code:
    head -n8 /etc/bash.bashrc.local.local
    Note that .local needs to be created
    Sorry what i meant was.
    Code:
    head -n8 /etc/bash.bashrc
    and create .local
    "Unfortunately time is always against us" -- [Morpheus]

    .:https://github.com/Jetchisel:.

Page 1 of 2 12 LastLast

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •