Fixing Time Machine problems

I had the problem that Time Machine was often stuck in “Preparing backup” or that the backup started and then was interrupted and didn’t finish. If you have similar problems you should check these things: Ensure that there is enough free space on your computer’s hard drive. It seems that Time Machine creates local backups … Continue reading “Fixing Time Machine problems”

I had the problem that Time Machine was often stuck in “Preparing backup” or that the backup started and then was interrupted and didn’t finish. If you have similar problems you should check these things:

  • Ensure that there is enough free space on your computer’s hard drive. It seems that Time Machine creates local backups on the computer and then uses these local backups to find out what needs to be copied to the backup disk. Additionally it uses snapshots, i.e. it freezes a copy of your hard drive when the backup starts so that the data is consistent. However that also means that files that are deleted during the running backup won’t free any space on your hard drive until the backup is finished. Modified files will exist twice until the backup is finished, i.e. the old and the new version. If these system is running out of space during the backup it seems that it might stop the backup and release the snapshot.
  • You can use the command
    log show --style syslog --predicate "subsystem == "com.apple.TimeMachine" AND processImagePath CONTAINS "backupd"" --info

    to see what the Time Machine is doing and check if any errors are displayed.
  • You can use the command
    sudo sysctl debug.lowpri_throttle_enabled=0
    to increase the speed of the backup by making it to continue to run the backup even while you are using your computer. Otherwise if the computer is too busy doing other things the backup will be paused until the computer is idle again.

Especially after freeing about 7% (70GB of 1TB) of space the backup seems to work fine now. I hope this will help you.

Signing a JavaFX Maven project for MacOS’ Guardkeeper

When creating a JavaFX application for MacOS as an “.app” file it is important to sign it correctly. If it isn’t signed correctly, the message “YourApp can’t be opened because it is from an unidentified developer.” will appear when a user tries to start the downloaded “.app” file: To fix this one can use the … Continue reading “Signing a JavaFX Maven project for MacOS’ Guardkeeper”

When creating a JavaFX application for MacOS as an “.app” file it is important to sign it correctly. If it isn’t signed correctly, the message “YourApp can’t be opened because it is from an unidentified developer.” will appear when a user tries to start the downloaded “.app” file:

To fix this one can use the javafx-maven-plugin. When using it you just have to add some information about your configuration to your pom.xml file. You can find further information on the project’s website but here is an example:

<plugin>
    <groupId>com.zenjava</groupId>
    <artifactId>javafx-maven-plugin</artifactId>
    <version>8.7.0</version>
    <configuration>
        <vendor>YourCompany</vendor>
        <updateExistingJar>true</updateExistingJar>
        <mainClass>YourMainClass</mainClass>
        <appName>YourAppName</appName>
        <verbose>true</verbose>
        <jvmArgs>
            <argument>-Djava.library.path=. -Xms168m -Xmx1024m -XX:+UseG1GC -XX:MinHeapFreeRatio=10 -XX:MaxHeapFreeRatio=30</argument>
        </jvmArgs>
        <bundleArguments>
            <mac.signing-key-developer-id-app>ABC</mac.signing-key-developer-id-app>
            <mac.signing-key-app>ABC</mac.signing-key-app>
            <mac.signing-key-developer-id-installer>DEF</mac.signing-key-developer-id-installer>
            <mac.signing-key-pkg>GHI</mac.signing-key-pkg>
        </bundleArguments>
        <additionalAppResources>libs</additionalAppResources>
    </configuration>
    <executions>
        <execution>
            <id>create-jfxjar</id>
            <phase>package</phase>
            <goals>
                <goal>build-jar</goal>
            </goals>
        </execution>
    </executions>
</plugin>

The important part is in the bundleArguments section. There you can define some parameters for the javapackager, which creates the native application. Depending on if you would like to distribute your application directly or via the Mac AppStore you have to enter different keys here. You can either enter the key’s name or its SHA-1 number (without spaces). Both can be found in the “Keychain Access” program.

After you have finished creating your “.app” file you can check if Guardkeeper will accept it:

# spctl -a -vvvv YourApplication.app

YourApplication.app: accepted
source=Developer ID
origin=Developer ID Application: YourName (YourID)

If it says “accepted” then it should work.