1 | #!/bin/bash
|
---|
2 |
|
---|
3 | download_sheets_separately=0
|
---|
4 |
|
---|
5 | gsheet_docid="1dBRRs7gqD46q21oDErw83NMK-9jY_DmuCvrzODDcgJI"
|
---|
6 |
|
---|
7 | output_filename_root="Willow Archive Directory"
|
---|
8 |
|
---|
9 | echo ""
|
---|
10 | echo "****"
|
---|
11 | echo "* The following wget call works if the document is publicly accessible"
|
---|
12 | echo "* "
|
---|
13 | echo "* If authentication is needed, then setup up rclone and copy using that"
|
---|
14 | echo "****"
|
---|
15 | echo ""
|
---|
16 |
|
---|
17 | echo "Sleeping for 5 secs before running command"
|
---|
18 | sleep 5
|
---|
19 | echo ""
|
---|
20 |
|
---|
21 | if [ $download_sheets_separately = 1 ] ; then
|
---|
22 |
|
---|
23 | #information_sheet="gid=969758927"
|
---|
24 | directory_sheet="gid=1389522865"
|
---|
25 | #objecttype_sheet="gid=0"
|
---|
26 | #theme_sheet="gid=459198218"
|
---|
27 |
|
---|
28 | echo "Downloading sheet 'directory':"
|
---|
29 |
|
---|
30 | wget --no-check-certificate \
|
---|
31 | -O "${output_filename_root}-directorysheet.xlsx" \
|
---|
32 | https://docs.google.com/spreadsheets/d/1j6_xry6OfLrdBkXeYZA8NTLCZwf-jr5DHlpGwAONLyY/export?$directory_sheet&format=xlsx
|
---|
33 |
|
---|
34 | else
|
---|
35 | echo ""
|
---|
36 | echo "Downloading full spreadsheet:"
|
---|
37 | echo " https://docs.google.com/spreadsheets/d/$gsheet_docid/export?format=xlsx&id=$gsheet_docid"
|
---|
38 | echo ""
|
---|
39 |
|
---|
40 | wget --no-check-certificate \
|
---|
41 | -O "${output_filename_root}.xlsx" \
|
---|
42 | "https://docs.google.com/spreadsheets/d/$gsheet_docid/export?format=xlsx&id=$gsheet_docid"
|
---|
43 |
|
---|
44 | echo ""
|
---|
45 | echo "----"
|
---|
46 | echo "Testing the file type of the downloaded file => expected to be 'xlxs'"
|
---|
47 | echo "----"
|
---|
48 |
|
---|
49 | # echo file "${output_filename_root}.xlsx"
|
---|
50 | echo " " `file "${output_filename_root}.xlsx"`
|
---|
51 | echo "----"
|
---|
52 | echo ""
|
---|
53 |
|
---|
54 | fi
|
---|
55 |
|
---|