Difference between revisions of "Make copy of file and copy to Server"

From rbachwiki
Jump to navigation Jump to search
Line 25: Line 25:
         dest: /mnt/c/Users/sales/Dropbox (Personal)/All Folders/websites/linode_msites/sb222/datab/sqLite_karaoke_backup.sql
         dest: /mnt/c/Users/sales/Dropbox (Personal)/All Folders/websites/linode_msites/sb222/datab/sqLite_karaoke_backup.sql
</pre>
</pre>
<h4 class="bluebackground">/cplocal.yml</h4>
<h4 class="bluebackground">cplocal.yml</h4>
<pre>
---
- name: copy for db to web folder
  hosts: localhost
 
  tasks:
    - name: copy file sql file to local webfolder
      copy:
      src: /mnt/c/Users/bacchas/Dropbox (Personal)/Filing Cabinet/Karaoke Stuff/sqlitedb/sqLite_karaoke.sql
      dest: /mnt/c/Users/bacchas/Dropbox (Personal)/All Folders/websites/linode_msites/rb222/database/
</pre>

Revision as of 15:07, 15 June 2023

#!/bin/bash
clear
echo -e " +++++ Making a backup copy of sql file in the web folder ++++++++++++++++ \n"
ansible-playbook /etc/ansible/playbook/backupsqlfirst.yml
sleep 5
echo -e "++++++++++ Copying to local web folder ++++++++++++++ \n"
ansible-playbook /etc/ansible/playbook/cplocal.yml
sleep 5
ansible-playbook  /etc/ansible/playbook/copytorb222.yml --private-key ~/.ssh/ansible
echo "+++++         Done            ++++++"

backupsqlfirst.yml

---
- name: make backup copy of sql file
  hosts: localhost

  tasks:
    - name: make a backup copy of sqlite file
      copy:
        src: /mnt/c/Users/sales/Dropbox (Personal)/All Folders/websites/linode_msites/sb222/datab/sqLite_karaoke.sql
        dest: /mnt/c/Users/sales/Dropbox (Personal)/All Folders/websites/linode_msites/sb222/datab/sqLite_karaoke_backup.sql

cplocal.yml

---
- name: copy for db to web folder
  hosts: localhost

  tasks:
    - name: copy file sql file to local webfolder
      copy:
       src: /mnt/c/Users/bacchas/Dropbox (Personal)/Filing Cabinet/Karaoke Stuff/sqlitedb/sqLite_karaoke.sql
       dest: /mnt/c/Users/bacchas/Dropbox (Personal)/All Folders/websites/linode_msites/rb222/database/