Announcement

Collapse
No announcement yet.

Crontab at reboot

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

    Crontab at reboot

    I generally find crontab easy to use but one thing no tutorial I found seems to cover is how to set something to reboot and also deal with a 15 min check to execute something if it is not already running. For example, I want the dropbox daemon to run after I reboot, but if I disconnect the hdd with the dropbox folder to burn a disc, the daemon still does not run after reconnecting the hdd unless I execute it manually. So I want crontab to start it after a reboot but also run it every 15 min if it died due to hot swapping drives.

    Sent from my DROID2 Global
    Last edited by Snowhog; Sep 08, 2019, 07:19 PM.
    OS: Kubuntu 12.10/Windows 8
    CPU: Intel Core i7 2600K
    Motherboard: Gigabyte GA-Z77X-UD5H
    Memory: 2x4GB Corsair Dominator
    Graphics Card: MSI R7770
    Monitor: Dell 2208WFP
    Mouse: Mionix NAOS 5000
    PSU: Corsair 520HX
    Case: Thermaltake Mozart TX
    Cooling: Thermalright TRUE Black Ultra-120 eXtreme CPU Heatsink Rev C
    Hard Drives: 1x180 GB Intel 330 SSD - 1xWD 1 TB Caviar Black - 1xWD 2 TB Caviar Green - 2xWD 3 TB Caviar Green

    #2
    You could also writing an upstart script for this rather than a cronjob, that way upstart can auto respawn the process if it crashes, this could also be combined with a udev rule to start the daemon when the drive is pluged in and possiblly stop it when it is unpluged. I think this approch is more elegent, and it will start the dropbox daemon sooner after you plug in the drive

    As for cron, you would need two rules:
    @reboot command
    */15 * * * * command
    where command could be a script to check if the daemon is already running/the drive is mounted or not and start it if they are.

    Comment


      #3
      Ok thanks for the tips james! I was trying */15 * * * * command but it would launch multiple daemons for some programs.
      OS: Kubuntu 12.10/Windows 8
      CPU: Intel Core i7 2600K
      Motherboard: Gigabyte GA-Z77X-UD5H
      Memory: 2x4GB Corsair Dominator
      Graphics Card: MSI R7770
      Monitor: Dell 2208WFP
      Mouse: Mionix NAOS 5000
      PSU: Corsair 520HX
      Case: Thermaltake Mozart TX
      Cooling: Thermalright TRUE Black Ultra-120 eXtreme CPU Heatsink Rev C
      Hard Drives: 1x180 GB Intel 330 SSD - 1xWD 1 TB Caviar Black - 1xWD 2 TB Caviar Green - 2xWD 3 TB Caviar Green

      Comment

      Working...
      X