Cloudron makes it easy to run web apps like WordPress, Nextcloud, GitLab on your server. Find out more or install now.


    Cloudron Forum

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular

    Solved Cron - which reference for volume ?

    Discuss
    3
    5
    189
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • timconsidine
      timconsidine last edited by timconsidine

      I have a volume set up /mnt/cctv to facilitate access between Homeassistant (capture) and Emby (view).

      I need to delete old cctv videos to avoid unnecessary disk use and keep video lists manageable in the apps.

      I plan to add a cron job like this using variable filename (videos named with format of yymmdd-hhmmss-location.mp4) :

      # *    *    *    *    * command to be executed
      7    4    *    *    *  rm /mnt/cctv/$(date --date "30 days ago" +%y%m%d)-*-*.* 
      

      Question :

      • should the command reference the mount point /mnt/cctv ?
      • or the location known to the app /media/cctv ?

      And will there be a permissions issue ?
      I guess if using /media/cctv it should be ok.
      So maybe the latter ?

      fbartels 1 Reply Last reply Reply Quote 0
      • fbartels
        fbartels App Dev @timconsidine last edited by

        Hi @timconsidine,

        maybe I am misunderstanding the problem, but since the cron is executed in the container/app it also need to be working with the path you seen in the container.

        timconsidine 1 Reply Last reply Reply Quote 2
        • timconsidine
          timconsidine @fbartels last edited by timconsidine

          @fbartels thank you, that answers the question : should be /media/cctv then

          When Cloudron sets up a volume on the server, it asks you to put it in /mnt
          But the app references this as /media in the Storage of app config.
          Maybe I am not understanding fully about Cloudron volume creation / management

          girish 1 Reply Last reply Reply Quote 0
          • girish
            girish Staff @timconsidine last edited by girish

            @timconsidine said in Cron - which reference for volume ?:

            When Cloudron sets up a volume on the server, it asks you to put it in /mnt

            Yes, correct, but this is purely "internal". AFAIK, this path is never shown in the UI. Maybe we missed some place.

            But the app references this as /media in the Storage of app config.

            As @fbartels said, the cron is run in context of container, so /media/<volumename> is the correct path.

            timconsidine 1 Reply Last reply Reply Quote 2
            • timconsidine
              timconsidine @girish last edited by timconsidine

              @girish Thank you.
              Not a UI issue at all. Just me not quite understanding.
              /media makes sense now.

              1 Reply Last reply Reply Quote 0
              • Topic has been marked as a question  nebulon nebulon 
              • Topic has been marked as solved  nebulon nebulon 
              • First post
                Last post
              Powered by NodeBB