Condition: bind a function to Transcend StoreJet's Backup button
Differential conditions: no driver for the button in Linux through USB3
Exclude: all graphical backup softwares

The product Transcend StoreJet 25M3 Anti-Shock has a backup button. I would like to that the press of the button starts the function

#!/usr/bin/env bash

# bind this script to the press of the button in the external HDD

# mchid for pkexec
pkexec env DISPLAY=:0 XAUTHORITY=$HOME/.Xauthority \
    tar czf /media/masi/Transcend/backup_home_10.7.2016.tar.gz $HOME/


  1. ask password for sudo
  2. How to Bind the button to the script?

System: Linux Ubuntu 16.04 64 bit
Linux kernel: 4.4 and 4.6
Linux kernel options: wl
Hardware: Macbook Air 2013-mid, ....
Related thread: Transcent StoreJet auto backup
External HDD: Transcend 1 TB StoreJet 25M3
Bash: 4.3.46(1)-release (x86_64-pc-linux-gnu)

  • 1
    I edited the script in my answer to automatically fill in the current date. 10.7.2016 for example.
    – mchid
    Commented Jul 10, 2016 at 19:32
  • Great! It is time to wait if there is any news about the driver or if it exists at all or any other approach to get the feature. Commented Jul 10, 2016 at 19:38

1 Answer 1


This is actually two questions and you should ask this as two questions instead of one.

With that said, you can use pkexec instead of sudo to get a prompt for a password before executing the script like so:


pkexec env DISPLAY=:0 XAUTHORITY=$HOME/.Xauthority tar czf media/masi/Transcend/backup_home_$(date +%d.%m.%Y | sed 's/\(0\)\(.\)\(\.\)/\2\3/g').tar.gz $HOME/

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .