summaryrefslogtreecommitdiff
path: root/pm-prepare
blob: ef8a0708c30cc3d8965dd52e1f7a9ea9d2ab8003 (plain)
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
81
82
83
84
#!/bin/sh

if [ "$#" -eq 0 ]
then
  echo "Must supply path to archive files"
  exit 1
fi

target="$1"

osname=`uname -s | sed -e 's/_NT-.*$/_NT/; s/^MINGW[0-9]*/CYGWIN/'`
if [ "$osname" = "CYGWIN_NT" -a -x /bin/cygpath ]
then
  target=`cygpath -w "$target"`
fi

target=${target%/}

if [ ! -d "$target" ]
then
  mkdir "$target"
fi

if [ ! -f "$target/CACHEDIR.TAG" ]
then
  cat >$target/CACHEDIR.TAG <<EOF
Signature: 8a477f597d28d172789f06886806bc55
# This file is a cache directory tag created by edirect.
# For information about cache directory tags, see:
#   http://www.brynosaurus.com/cachedir/
EOF
fi

if [ "$osname" = "Darwin" ]
then
  echo ""
  echo "  To prepare the disk for an EDirect archive, please disable:"
  echo ""
  echo "    Antivirus scanning"
  echo "    Spotlight indexing"
  echo "    Time Machine backups"
  echo ""
  echo "  for the '$target' directory."
  echo ""
fi

if [ "$osname" = "Linux" ]
then
  echo ""
  echo "  To prepare the disk for an EDirect archive, please disable:"
  echo ""
  echo "    Antivirus scanning"
  echo ""
  echo "  for the '$target' directory."
  echo ""
  echo "  You may also need to run a command like:"
  echo ""
  echo "    sudo mkfs -t ext4 -b 1024 -I 128 -i 4096 /dev/<device-name>"
  echo ""
  echo "  to configure the file system for a large number of inodes."
  echo ""
fi

if [ "$osname" = "CYGWIN_NT" ]
then
  echo ""
  echo "  To prepare the disk for an EDirect archive, please disable:"
  echo ""
  echo "    Antivirus scanning"
  echo ""
  echo "  for the '$target' directory."
  echo ""

  if reg query 'HKLM\System\CurrentControlSet\Control\FileSystem' \
    /v NtfsDisable8dot3NameCreation | fgrep -q 0x0
  then
    echo "  Also ask your administrator to set:"
    echo ""
    echo "    NtfsDisable8dot3NameCreation"
    echo ""
    echo "  in the Windows Registry."
    echo ""
  fi
fi