unified logname uses into fm_username
[feisty_meow.git] / scripts / archival / compare_backup_drive.sh
1 #!/bin/bash
2
3 # compares the soapbox with the real archive to see if any older stuff might be
4 # left behind.  if it's got a less than in front, then it's only on the soapbox drive
5 # now rather than the pc's hard drive.
6
7 source "$FEISTY_MEOW_SCRIPTS/core/launch_feisty_meow.sh"
8
9 function compare_archives_with_target()
10 {
11   local target="$1"; shift
12
13 echo compare arch with target: $target
14
15   for currdir in $MAJOR_ARCHIVE_SOURCES; do
16     sep
17     echo "comparing '$currdir' with target '$target', where 'less thans' are on the target..."
18 echo would do--    compare_dirs "$target/$(basename $currdir)" "$currdir"
19   done
20 }
21
22 # decide which drive to compare.
23 targets="$1"
24 if [ -z "$targets" ]; then
25   targets=($($(which ls) -1 /media/$USER/*))
26   if [ ${#targets[@]} -gt 1 ]; then
27     echo "
28 Please provide a media drive name on the command line, because more than
29 one possibility exists.
30 "
31     exit 1
32   fi
33 fi
34
35 echo "comparing the media drive '${targets[0]}' against local archives."
36
37 compare_archives_with_target "/media/$USER/${targets[0]}"
38
39 sep
40