Linux File Timestamps Explained: atime, mtime, and ctime

Today I discovered an article explaining Linux file system timestamps: Linux File Timestamps Explained: atime, mtime, and ctime; and a good thing too, because I always thought ‘ctime’ was ‘create time’, but not so! Turns out that ‘ctime’ is ‘change time’, similar to ‘mtime’ but apparently cannot be set from userspace. My investigations were prompted by my investigations info how `borg create` identified changed files.

Omitting date completed from MySQL dump file

By default when you run a dump with ‘mysqldump’ the date of the dump is appended to the file, e.g.:

jj5@love:~/desktop/experiment$ udiff *
--- dbt__jj_dev_1__svn_jdrepo.1.sql     2019-06-11 18:11:13.267758230 +1000
+++ dbt__jj_dev_1__svn_jdrepo.2.sql     2019-06-11 18:12:03.856075974 +1000
@@ -32,4 +32,4 @@

--- Dump completed on 2019-06-10 21:59:44
+-- Dump completed on 2019-06-10 12:06:49

This causes dumps for a single database that has not changed to have two dumps which differ. It’s better to have dumps from the same unchanged database to be the same. To facilitate that add the –skip-dump-date option when running ‘mysqldump’.

See here for the back-story.

Salt file.recurse source file not found (file encoding issue)

So I was running this:

    - clean: True
    - user: root
    - group: root
    - dir_mode: 755
    - file_mode: 644
    - source: salt://inst/mediawiki-1.29
    - require:
      - pkg: apache2

And getting an error like this:

          ID: /var/www/
    Function: file.recurse
      Result: False
     Comment: #### /var/www/ ####
              Source file 'salt://inst/mediawiki-1.29/vendor/james-heinrich/getid3/getid3/' not found

              #### /var/www/ ####
              Source file 'salt://inst/mediawiki-1.29/vendor/james-heinrich/getid3/getid3/' not found
     Started: 14:27:18.352264
    Duration: 134735.945 ms

The issue was that the source files mentioned weren’t in UTF-8 format. To convert the files I ran, e.g.:

$ iconv -f WINDOWS-1252 -t UTF-8//TRANSLIT < >

(Actually I couldn’t get the ‘iconv’ command to work so I edited manually in Vim)

If Apache2 won’t serve your JavaScript file try…

I had an issue with Apache2 improperly serving a JavaScript file which I seem to have fixed by making sure the file was terminated with a new-line character… this was really hard to diagnose and resolve! The behaviour in Firefox was that the file just didn’t finish to download, whereas the Apache2 logs indicated a 200 result… I think it may have had something to do with automatic compression, which is a dark art that I do not understand (mumbles something about mod deflate…).

KCachegrind doesn’t open cachegrind profiler log file

So I had an issue with KCachegrind where I would open a cachegrind profile file and “nothing happened”. The status bar said the file had loaded, but the user interface widgets were all empty. Turns out clicking Settings -> Sidebars -> Function Profile loaded the part of the UI I needed to get started… everything is easy when you know how!