For copying files keeping modtime, easiest to use rsync: rync -trv [source] [target]
(times, recursive, verbose)
Add -n
for dry-run.
For queuing tasks:
- Install task spooler
sudo apt-get install task-spooler
- Queue commands with
tsp {command}
- To mail result, add
TS_MAILTO
:export TS_MAILTO=address@domain
- Queue with different working directory and mail result:
tsp -m bash -c '(pushd /dir/to/enter && {command}; popd)'
Python defaults to ASCII sys.output encoding even if terminal is UTF-8. To fix use: PYTHONIOENCODING=utf-8:surrogateescape python script.py