diff options
author | Jonathan Herman <hermanjl@cs.unc.edu> | 2013-05-01 15:48:01 -0400 |
---|---|---|
committer | Jonathan Herman <hermanjl@cs.unc.edu> | 2013-05-01 15:48:01 -0400 |
commit | cd9f1b026cc5c4526dfbd2f7b1c5f39edb6a7309 (patch) | |
tree | 5b6221e55d7f50c88a574ed4f57ff7efd9b7103d /common.py | |
parent | 94cc65997d237ddeab24d396f06bb93bc0644a9d (diff) |
Added --crontab option to run_exps.py
This will use crontab to automatically restart the machine and resume
the script when the machine crashes. An additional option, -k, is provided
to cancel this operation.
Diffstat (limited to 'common.py')
-rw-r--r-- | common.py | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -182,7 +182,7 @@ def ft_freq(): | |||
182 | 182 | ||
183 | 183 | ||
184 | def kernel(): | 184 | def kernel(): |
185 | return subprocess.check_output(["uname", "-r"]) | 185 | return subprocess.check_output(["uname", "-r"]).strip("\n") |
186 | 186 | ||
187 | def is_executable(fname): | 187 | def is_executable(fname): |
188 | '''Return whether the file passed in is executable''' | 188 | '''Return whether the file passed in is executable''' |
@@ -210,3 +210,6 @@ def log_once(id, msg = None, indent = True): | |||
210 | if indent: | 210 | if indent: |
211 | msg = ' ' + msg.strip('\t').replace('\n', '\n\t') | 211 | msg = ' ' + msg.strip('\t').replace('\n', '\n\t') |
212 | sys.stderr.write('\n' + msg.strip('\n') + '\n') | 212 | sys.stderr.write('\n' + msg.strip('\n') + '\n') |
213 | |||
214 | def get_cmd(): | ||
215 | return os.path.split(sys.argv[0])[1] | ||