-
Notifications
You must be signed in to change notification settings - Fork 0
/
bashrc_lfe
80 lines (69 loc) · 2.08 KB
/
bashrc_lfe
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
#!/bin/bash
# Created by: L. Matilsky
# Date Created: 07/05/2016
#
# state what's going on
echo $bufferstring
echo "Executing $brclfe"
# "bashrc_lfe" (you are here) contains more commands specific to lou;
# # i.e., unmigrating from tape, backing things up, etc.
#
# To unmigrate an entire directory from tape, do
# unmigrate dir_name on an LFE
unmigrate() {
dmfind $1 -state MIG -o -state OFL -o -state PAR | dmget
}
# SHIFT transfer stuff
# Note: to extract particular files from a *.tar folder, run
# shiftc --extract-tar --include=[fname] tarname.tar .
shiftfrom () {
shiftc --extract-tar --hosts=6 $1/*.tar $2
}
shiftto () {
shiftc --create-tar --index-tar --hosts=6 $1 $2/name.tar
}
shist() {
shiftc --history --id=$1
}
# command to extract the post-processed data (but not whole binary folder)
# from a tarball on LFE
get_data() {
shiftc --extract-tar --include='equation_coefficients|custom_reference_binary|grid_info|main_input|jobinfo.txt|.*\.o.*|.*script|logfile.*|data/.*|plots/.*' $1 $2
}
# command to backup a single directory
backup_dir() {
origdir=`pwd`
maindir=$1
fullpath=`readlink -f $maindir`
basedir=`basename $fullpath`
backupdir=$HOME_LFE/${basedir}_$(date +%F_%H.%M)
mkdir $backupdir
cd $fullpath
echo 'backing up'
echo $fullpath
echo 'to'
echo $backupdir/name.tar
shiftc --create-tar --index-tar --hosts=6 * $backupdir/name.tar
cd $origdir
}
# Backup the whole PFE home directory (USE CAUTION!!!)
backup_homepfe() {
backupdir=$HOME_LFE/homepfe_$(date +%F_%H.%M)
mkdir $backupdir
shiftc --create-tar --index-tar --hosts=6 $HOME_PFE/ $backupdir/name.tar
}
# Backup the whole /nobackup/backitup directory (USE CAUTION!!!)
backup_nobackup() {
backupdir=$HOME_LFE/backitup_$(date +%F_%H.%M)
mkdir $backupdir
bash $rau/bash/backup_subdirs.sh $nb/backitup/ $backupdir/
}
# Backup the whole /nobackup directory (USE ULTRA CAUTION!!!)
#
backup_nobackup_whole() {
backupdir=$HOME_LFE/nb_$(date +%F_%H.%M)
mkdir $backupdir
bash $rau/bash/backup_subdirs.sh $nb/ $backupdir/
}
# Source bashrc_pfe
sbpfe