nmrfolderfix is a bash script for renaming NMR data folders that have problematic names, specifically folders that are identically named except for case differences (which are unique in Linux but indistinguishable on Windows and Mac), as well as for folders that end in a period (which is permissible on Linux and Mac but not on Windows). The purpose is to allow other scripts (such as https://github.com/greenwoodad/nmrsync) to automatically copy data from the Linux file system that the data was collected on to a windows file system. An email is optionally sent to the NMR manager.
I recommend running this as a cron job every five minutes on each workstation collecting NMR data.
This script requires a linux operating system (I've run it in in CentOS 6.8, 7.5 and 5.1). I've only tested this with Bruker NMR data, but future releases may be able to handle file structures generated by other instruments.
The email feature requires that the application sendmail is working on the machine running the script.
git clone https://github.com/greenwoodad/nmrfolderfix
or
git clone https://(your github username)@github.com/greenwoodad/nmrfolderfix.git
followed by:
chmod +x ./nmrfolderfix/nmrfolderfix
nmrfolderfix [OPTIONS]... path/to/data
Options
-h, -?, --help
Show help message.
-p, --path
Set path to data (flag optional).
-n, --nmr (default 'y')
Set to 'y' for the default /(user)/nmr/(data set)/(expt #)
data organization. Set it to 'n' for data organized as
/(user)/(data set)/(expt #)
-e, --email (default '')
Provide an email address to receive emails when
folders are renamed.
To run this as a cron job, make an entry in your crontab like this:
*/5 * * * * /path/to/nmrfolderfix '/path/to/data'
Pull requests and bug reports are welcome.
- Alex Greenwood - provided script - Greenwoodad