Announcement

Collapse
No announcement yet.

CRON Issue

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    CRON Issue

    im having to make a dummy post first it wont let me post the output to this post because it says im new and cant post links. grrr

    #2
    Hi folks!

    New to this forum, just wanted to ask :

    I have CRON set up to run 3 tasks

    at 12:30 AM CST -- run dropbox and backup data

    at 12:45 AM CST - Run spotify and sync any new songs I added to the list

    at 4:30 AM CST - Log off

    The reason is because I am on Sat. Internet and I cant do any of those things during the day for it eating my data cap up.



    So it looks like by /var/log/syslog everything ran BUT logging off:

    Dec 22 00:30:01 COMPAQ CRON[24886]: (chris) CMD (dropbox start -i)
    Dec 22 00:30:04 COMPAQ CRON[24885]: (CRON) info (No MTA installed, discarding output)
    Dec 22 00:45:01 COMPAQ CRON[24968]: (chris) CMD (spotify )
    Dec 22 00:45:01 COMPAQ CRON[24967]: (CRON) info (No MTA installed, discarding output)
    Dec 22 01:17:01 COMPAQ CRON[24976]: (root) CMD ( cd / && run-parts --report /etc/cron.hourly)
    Dec 22 02:17:01 COMPAQ CRON[24990]: (root) CMD ( cd / && run-parts --report /etc/cron.hourly)
    Dec 22 03:17:01 COMPAQ CRON[25006]: (root) CMD ( cd / && run-parts --report /etc/cron.hourly)
    Dec 22 04:17:01 COMPAQ CRON[25024]: (root) CMD ( cd / && run-parts --report /etc/cron.hourly)
    Dec 22 04:30:01 COMPAQ CRON[25029]: (chris) CMD (qdbus org.kde.ksmserver /KSMServer org.kde.KSMServerInterface.logout -1 -1 -1)
    Dec 22 04:30:01 COMPAQ CRON[25028]: (CRON) info (No MTA installed, discarding output)

    so how come it didnt log off?

    Also it was suppose to email me and let me know if everything went ok but it didnt do that either =[



    how did I input the tasks for cron?
    ----------------------------------------------------
    I installed the Cron front end for KDE and put all the tasks in that way. then went K menu typed in task.... and clicked on the icon.


    Thank you,
    Christopher


    Comment


      #3
      Cron & Posting

      There is the Postfix:

      https://help.ubuntu.com/community/Postfix
      https://help.ubuntu.com/10.04/serverguide/postfix.html

      At here:

      Installing the mailutils and setting the local post.




      Trying the dbus command -> It is not working but there is post for me:

      :~$ mail
      "/var/mail/rog132": 1 message 1 new
      >N 1 Cron Daemon Sun Dec 22 18:55 17/705 Cron <rog132@fox6> qdbus org.kde.ksmserver /KSMServer org.kde.K

      Return-Path: <rog132@fox6>
      X-Original-To: rog132
      Delivered-To: rog132@fox6
      Received: by fox6 (Postfix, from userid 1000)
      id 3B423216F6; Sun, 22 Dec 2013 18:55:01 +0200 (EET)
      From: root@fox6 (Cron Daemon)
      To: rog132@fox6
      Subject: Cron <rog132@fox6> qdbus org.kde.ksmserver /KSMServer org.kde.KSMServerInterface.logout -1 -1 -1
      Content-Type: text/plain; charset=ANSI_X3.4-1968
      X-Cron-Env: <SHELL=/bin/sh>
      X-Cron-Env: <HOME=/home/rog132>
      X-Cron-Env: <PATH=/usr/bin:/bin>
      X-Cron-Env: <LOGNAME=rog132>
      Message-Id: <20131222165501.3B423216F6@fox6>
      Date: Sun, 22 Dec 2013 18:55:01 +0200 (EET)

      Could not connect to D-Bus server: org.freedesktop.DBus.Error.NotSupported: Unable to autolaunch a dbus-daemon without a $DISPLAY for X11

      ? q
      Saved 1 message in /home/rog132/mbox
      Held 0 messages in /var/mail/rog132
      The problem is that the cron is 'special' - it needs the 'export DISPLAY=:0' before the command.

      Code:
      export DISPLAY=:0 && qdbus org.kde.ksmserver /KSMServer org.kde.KSMServerInterface.logout -1 -1 -1


      (note! - the KCron doesn't like the export - the export part was added with the 'crontab -e')

      Now the logout is working but there are still error mail:
      Error: org.freedesktop.DBus.Error.NoReply
      Did not receive a reply. Possible causes include: the remote application did not send a reply, the message bus security policy blocked the reply, the reply timeout expired, or the network connection was broken.

      Other options to 'logout': http://askubuntu.com/questions/15795...a-the-terminal. Maybe the 'pkill user' works without the 'export Display'.

      The KShutdown (http://kshutdown.sourceforge.net/ ) has a clean command option:

      man kshutdown

      NAME
      kshutdown - A Shut Down Utility for KDE

      SYNOPSIS
      kshutdown [Qt-options] [KDE-options] [options] time


      -l, --logout
      End current session
      It is working from the konsole but the Cron is whining of the dbus...


      More links

      - Thread: HowTo make cron run GUI applications: http://ubuntuforums.org/showthread.php?t=105250

      - Unable to autolaunch a dbus-daemon without a $DISPLAY for X11: https://bugs.launchpad.net/ubuntu/+s...t/+bug/1242992
      Last edited by Rog132; Dec 22, 2013, 12:18 PM.
      A good place to start: Topic: Top 20 Kubuntu FAQs & Answers
      Searching FAQ's: Google Search 'FAQ from Kubuntuforums'

      Comment


        #4
        Hi

        Sorry I can't offer any technical advice, I'm a noob to *nix. I 'converted' to Ubuntu back in Oct 2011 from XP (which was by far the BEST move I EVER did). But my understanding is that Dropbox is a 'copy' of certain folders that you want to share, so if you delete anything in the folder, it also removes it from the online 'mirror'. Please enlighten me as to whether I am wrong or not!
        Kubuntu 18.04LTS~64bit|Plasma 5.12.9|KDE 5.47.0|QT 5.9.5|Linux 5.3.0.40~generic|M5A78L-M USB3|BIOS 2101|AMD PhenomII X4 965 3400+|P8H77-I Motherboard NIC|8.0GB PC3-10600 1333Mhz CL9 (9-9-9-24)DDR3

        Comment

        Working...
        X