-
-
Save Inkimar/2a8faf02dc8223e81a3c7d401741c976 to your computer and use it in GitHub Desktop.
Q1: use gpg in the script, fetch psw from file does not work ... | |
Q2: use scp to cp the file to a remote location | |
info: mysqldump + tarring all the redmine_files ... becomes an tar. | |
#!/bin/bash | |
source .env/.env.db | |
TARGET=tst | |
NOW=`date +"%Y-%m-%d"` | |
TARGET_DIR=$TARGET/$NOW | |
mkdir $TARGET_DIR | |
docker exec -it mariadb_redmine sh -c "mysqldump -u $user -p$psw $db > /tmp/redmine_$NOW.sql" | |
docker cp mariadb_redmine:/tmp/redmine_$NOW.sql $TARGET_DIR | |
tar -zcvf $TARGET_DIR/redmine-files_$NOW.tar.gz redmine-files | |
#tarring mysql-dump and redmine-files | |
cd $TARGET && tar -zcvf backup_$NOW.tar.gz $NOW | |
# sudo apt-get install gnupg2 | |
#gpg -c | |
#gpg -c backup_$NOW.tar.gz #asks for password | |
#secure copy , scp, backup_$NOW.tar.gz |
or use --passphrase-file ....
#ascii
gpg2 --yes --batch --passphrase=xxxxx -a -c test.csv
#not ascii
gpg2 --yes --batch --passphrase-file .passfile -c test.csv
Installation : http://internetarchive.readthedocs.io/en/latest/installation.html
sudo pip install internetarchive
http://internetarchive.readthedocs.io/en/latest/cli.html
http://internetarchive.readthedocs.io/en/latest/quickstart.html#configuring
- run the '
ia configure
' , creates the file ./config/ia.ini
template :ia upload <identifier> file1 file2 --metadata="mediatype:texts" --metadata="blah:arg"
- run : ``ia upload inkimar-testing-5 test.csv.asc --metadata="mediatype:texts
"
response:
Error retrieving metadata from https://archive.org/metadata/inkimar-testing-5, You are attempting to make an HTTPS request on an insecure platform, please see:
https://internetarchive.readthedocs.org/en/latest/troubleshooting.html#https-issues
https://internetarchive.readthedocs.io/en/latest/troubleshooting.html#https-issues
Test
If you are using a Python version earlier than 2.7.9, you might see InsecurePlatformWarning and SNIMissingWarning warnings and your requests might fail. There are a few options to address this issue:
Upgrade your Python to version 2.7.9 or more recent.
Install or upgrade the following Python modules as documented here: PyOpenSSL, ndg-httpsclient, and pyasn1.
Use HTTP to make insecure requests in one of the following ways:
Adding the following lines to your ia.ini config file (usually located at ~/.config/ia.ini or ~/.ia.ini):
[general]
secure = false
https://askubuntu.com/questions/725171/update-python-2-7-to-latest-version-of-2-x
sudo add-apt-repository ppa:jonathonf/python-2.7
sudo apt-get update
sudo apt-get install python2.7
python --version
updated python
$ python --version
Python 2.7.13+
removed .config/ia.ini
runnning ia configure once again.
$ ia configure
Enter your Archive.org credentials below to configure 'ia'.
Email address: inkimar@gmail.com
Password:
Config saved to: /home/ingimar/.config/ia.ini
test to upload a file to my account
ia upload inkimar-testing-5 test.csv.asc --metadata="mediatype:texts"
Works!
ia upload inkimar-testing-5 test.csv.asc --metadata="mediatype:texts"
inkimar-testing-5:
uploading test.csv.asc: [################################] 1/1 - 00:00:00
From start to finsih.
- upgrade python (2.7.13+)
- mkdir .config
- sudo pip install internetarchive ( pip not installed)
- sudo apt-get install python-pip ... trouble ..
https://askubuntu.com/questions/597906/how-to-install-pip-and-a-python-package-for-self-installed-python
- get pip https://pip.pypa.io/en/latest/installing/#id9
- python get-pip.py
upgrade pip
pip install --upgrade pip
try 3. again
3. sudo pip install internetarchive ( pip not installed)
-
configure ia
ia configure
Config saved to: /root/.config/ia.ini -
try to upload a dummy-file.
gpg2 --yes --batch --passphrase-file .passfile_ingimar -a -c test-wrangler-1.txt
creates -> test-wrangler-1.txt.asc
gpg2 was already installed.
ia upload ingimar-wrangler_20170905 test-wrangler-1.txt.asc --metadata="mediatype:texts"
apt-get install gnupg2
using gpg2, non-interactive
gpg2 --yes --batch --passphrase=myname -c sales.spending.csv