40m QIL Cryo_Lab CTN SUS_Lab TCS_Lab OMC_Lab CRIME_Lab FEA ENG_Labs OptContFac Mariner WBEEShop
  40m Log  Not logged in ELOG logo
Entry  Mon Aug 14 19:41:46 2017, Jamie, Update, CDS, front-end/DAQ network down for kernel upgrade, and timing errors 
    Reply  Wed Aug 16 17:05:53 2017, Jamie, Update, CDS, front-end/DAQ network down for kernel upgrade, and timing errors 2017-08-16-163725_1366x495_scrot.png
       Reply  Wed Aug 16 17:14:02 2017, Koji, Update, CDS, front-end/DAQ network down for kernel upgrade, and timing errors 
          Reply  Wed Aug 16 18:01:28 2017, Jamie, Update, CDS, front-end/DAQ network down for kernel upgrade, and timing errors 
             Reply  Wed Aug 16 18:06:01 2017, Koji, Update, CDS, front-end/DAQ network down for kernel upgrade, and timing errors 
       Reply  Wed Aug 16 18:50:58 2017, Jamie, Update, CDS, front-end/DAQ network down for kernel upgrade, and timing errors 2017-08-16-184910_1394x488_scrot.png
          Reply  Mon Aug 28 16:20:00 2017, gautam, Update, CDS, 40m files backup situation 
             Reply  Mon Aug 28 17:13:57 2017, ericq, Update, CDS, 40m files backup situation 
             Reply  Fri Sep 15 15:54:28 2017, gautam, Update, CDS, FB wiper script 
                Reply  Mon Sep 18 17:17:49 2017, gautam, Update, CDS, FB wiper script 
                   Reply  Mon Sep 18 17:30:54 2017, Chris, Update, CDS, FB wiper script wiper.pl
                      Reply  Mon Sep 18 17:51:26 2017, gautam, Update, CDS, FB wiper script perlDiff.png
                         Reply  Mon Sep 18 18:40:34 2017, gautam, Update, CDS, FB wiper script 
             Reply  Tue Sep 26 15:55:20 2017, gautam, Update, CDS, 40m files backup situation 
                Reply  Thu Sep 28 10:33:46 2017, gautam, Update, CDS, 40m files backup situation 
                   Reply  Thu Sep 28 11:13:32 2017, jamie, Update, CDS, 40m files backup situation 
                      Reply  Thu Sep 28 23:47:38 2017, gautam, Update, CDS, 40m files backup situation 
                         Reply  Fri Sep 29 11:07:16 2017, gautam, Update, CDS, 40m files backup situation 
                            Reply  Thu Oct 5 13:58:26 2017, gautam, Update, CDS, 40m files backup situation 
                               Reply  Fri Oct 6 12:46:17 2017, gautam, Update, CDS, 40m files backup situation 
                                  Reply  Sat Oct 28 00:36:26 2017, gautam, Update, CDS, 40m files backup situation - ddrescue 415E2F09-3962-432C-B901-DBCB5CE1F6B6.jpegBFF8F8B5-1836-4188-BDF1-DDC0F5B45B41.jpeg
Message ID: 13320     Entry time: Mon Sep 18 18:40:34 2017     In reply to: 13319
Author: gautam 
Type: Update 
Category: CDS 
Subject: FB wiper script 

I did a further check on the wiper script by changing the "percent_keep" from 85.0 to 75.0, and running the script in "dry_run" mode again. The script then output to console the names of all the files it would delete in order to free up the required amount of space (but didn't actually delete any files as it was a dry run). Seemed to be sensible.

To set up the cron job, I did the following on FB1:

  • crontab -e opened up the crontab
  • Copied over a script called "wiper.cron" from /opt/rtcds/caltech/c1/target/fb to /opt/rtcds/caltech/c1/target/daqd. This essentially contains a bunch of instructions to run the wiper script with the --delete flag, and write the console output to a log file.
  • Added the following line: 33 3 * * * /opt/rtcds/caltech/c1/target/daqd/wiper.cron. So the cron job should be executed at 3:33AM everyday.
  • The cron daemon seems to be running - sudo systemctl status cron.service yields the following output:
    controls@fb1:~ 0$ sudo systemctl status cron.service
    ● cron.service - Regular background program processing daemon
       Loaded: loaded (/lib/systemd/system/cron.service; enabled)
       Active: active (running) since Mon 2017-09-18 18:16:58 PDT; 27min ago
         Docs: man:cron(8)
     Main PID: 30183 (cron)
       CGroup: /system.slice/cron.service
               └─30183 /usr/sbin/cron -f
    Sep 18 18:16:58 fb1 cron[30183]: (CRON) INFO (Skipping @reboot jobs -- not system startup)
    Sep 18 18:17:01 fb1 CRON[30205]: pam_unix(cron:session): session opened for user root by (uid=0)
    Sep 18 18:17:01 fb1 CRON[30206]: (root) CMD (   cd / && run-parts --report /etc/cron.hourly)
    Sep 18 18:17:01 fb1 CRON[30205]: pam_unix(cron:session): session closed for user root
    Sep 18 18:25:01 fb1 CRON[30820]: pam_unix(cron:session): session opened for user root by (uid=0)
    Sep 18 18:25:01 fb1 CRON[30821]: (root) CMD (command -v debian-sa1 > /dev/null && debian-sa1 1 1)
    Sep 18 18:25:01 fb1 CRON[30820]: pam_unix(cron:session): session closed for user root
    Sep 18 18:35:01 fb1 CRON[31515]: pam_unix(cron:session): session opened for user root by (uid=0)
    Sep 18 18:35:01 fb1 CRON[31516]: (root) CMD (command -v debian-sa1 > /dev/null && debian-sa1 1 1)
    Sep 18 18:35:01 fb1 CRON[31515]: pam_unix(cron:session): session closed for user root

     

  • crontab -l on FB1 now shows the following:
    controls@fb1:~ 0$ crontab -l
    # Edit this file to introduce tasks to be run by cron.
    #
    # Each task to run has to be defined through a single line
    # indicating with different fields when the task will be run
    # and what command to run for the task
    #
    # To define the time you can provide concrete values for
    # minute (m), hour (h), day of month (dom), month (mon),
    # and day of week (dow) or use '*' in these fields (for 'any').#
    # Notice that tasks will be started based on the cron's system
    # daemon's notion of time and timezones.
    #
    # Output of the crontab jobs (including errors) is sent through
    # email to the user the crontab file belongs to (unless redirected).
    #
    # For example, you can run a backup of all your user accounts
    # at 5 a.m every week with:
    # 0 5 * * 1 tar -zcf /var/backups/home.tgz /home/
    #
    # For more information see the manual pages of crontab(5) and cron(8)
    #
    # m h  dom mon dow   command
    33 3 * * * /opt/rtcds/caltech/c1/target/daqd/wiper.cron

Let's see if this works.

Quote:

Since the script seems to be working now, I am going to set it up on FB1's crontab. Thanks Chris!.

 

ELOG V3.1.3-