Snapshots:Example: Difference between revisions

From UMIACS
Jump to navigation Jump to search
No edit summary
No edit summary
 
(One intermediate revision by the same user not shown)
Line 13: Line 13:
<pre>
<pre>
username@host:~/virtualenv$ ls
username@host:~/virtualenv$ ls
appveyor.yml  bin              docs        MANIFEST.in  scripts    setup.py tox.ini              virtualenv.py
appveyor.yml     docs        scripts    tox.ini
AUTHORS.txt  CONTRIBUTING.rst LICENSE.txt README.rst  setup.cfg  tests     virtualenv_embedded  virtualenv_support
AUTHORS.txt      LICENSE.txt setup.cfg  virtualenv_embedded
bin              MANIFEST.in  setup.py   virtualenv.py
CONTRIBUTING.rst  README.rst  tests     virtualenv_support
</pre>
</pre>
<pre>
<pre>
Line 29: Line 31:
<pre>
<pre>
username@host:~/virtualenv$ ls
username@host:~/virtualenv$ ls
appveyor.yml  bin              docs        MANIFEST.in  scripts    setup.py tox.ini             virtualenv_support
appveyor.yml  CONTRIBUTING.rst  MANIFEST.in  setup.cfg tox.ini
AUTHORS.txt  CONTRIBUTING.rst  LICENSE.txt  README.rst  setup.cfg  tests     virtualenv_embedded
AUTHORS.txt  docs              README.rst  setup.py  virtualenv_embedded
bin          LICENSE.txt      scripts      tests     virtualenv_support
</pre>
</pre>


Line 36: Line 39:
<pre>
<pre>
username@host:~/virtualenv$ ls /nfshomes/username/.snapshot
username@host:~/virtualenv$ ls /nfshomes/username/.snapshot
nfshomes_2024-06-25_00:00  nfshomes_2024-06-26_16:00 nfshomes_2024-06-27_04:00  Weekly_nfshomes_2024-06-16_00:00
nfshomes_2024-06-25_00:00  nfshomes_2024-06-27_04:00
nfshomes_2024-06-26_00:00  nfshomes_2024-06-26_20:00 nfshomes_2024-06-27_08:00  Weekly_nfshomes_2024-06-23_00:00
nfshomes_2024-06-26_00:00  nfshomes_2024-06-27_08:00
nfshomes_2024-06-26_12:00  nfshomes_2024-06-27_00:00 nfshomes_2024-06-27_12:00
nfshomes_2024-06-26_12:00  nfshomes_2024-06-27_12:00
nfshomes_2024-06-26_16:00  Weekly_nfshomes_2024-06-16_00:00
nfshomes_2024-06-26_20:00  Weekly_nfshomes_2024-06-23_00:00
nfshomes_2024-06-27_00:00
</pre>
</pre>
<pre>
<pre>
Line 47: Line 53:
<pre>
<pre>
username@host:~/.snapshot/Weekly_nfshomes_2024-06-23_00:00/virtualenv$ ls
username@host:~/.snapshot/Weekly_nfshomes_2024-06-23_00:00/virtualenv$ ls
appveyor.yml  bin              docs        MANIFEST.in  scripts    setup.py tox.ini              virtualenv.py
appveyor.yml     docs        scripts    tox.ini
AUTHORS.txt  CONTRIBUTING.rst LICENSE.txt README.rst  setup.cfg  tests     virtualenv_embedded  virtualenv_support
AUTHORS.txt      LICENSE.txt setup.cfg  virtualenv_embedded
bin              MANIFEST.in  setup.py   virtualenv.py
CONTRIBUTING.rst  README.rst  tests     virtualenv_support
</pre>
</pre>


Line 58: Line 66:
Change back to the original directory.
Change back to the original directory.
<pre>
<pre>
username@host:~/.snapshots/Weekly_nfshomes_2024-06-23_00:00/virtualenv$ cd /nfshomes/username/virtualenv/
username@host:~/.snapshot/Weekly_nfshomes_2024-06-23_00:00/virtualenv$ cd /nfshomes/username/virtualenv/
</pre>
</pre>


Line 64: Line 72:
<pre>
<pre>
username@host:~/virtualenv$ ls
username@host:~/virtualenv$ ls
appveyor.yml  bin              docs        MANIFEST.in  scripts    setup.py tox.ini              virtualenv.py
appveyor.yml     docs        scripts    tox.ini
AUTHORS.txt  CONTRIBUTING.rst LICENSE.txt README.rst  setup.cfg  tests     virtualenv_embedded  virtualenv_support
AUTHORS.txt      LICENSE.txt setup.cfg  virtualenv_embedded
bin              MANIFEST.in  setup.py   virtualenv.py
CONTRIBUTING.rst  README.rst  tests     virtualenv_support
</pre>
</pre>


[[Category:Snapshots]]
[[Category:Snapshots]]
__NOTOC__
__NOTOC__

Latest revision as of 20:01, 16 September 2024

Note that in this example, the directory .snapshot could also be .zfs/snapshot depending on the filer serving your host. You can try to ls -l one and if it doesn't exist, try the other.


For this example, the user is logged into host with the username username, and a virtual environment directory named virtualenv exists in the home directory.

username@host:~/virtualenv$ pwd
/nfshomes/username/virtualenv

A Python file named virtualenv.py exists in the directory.

username@host:~/virtualenv$ ls
appveyor.yml      docs         scripts    tox.ini
AUTHORS.txt       LICENSE.txt  setup.cfg  virtualenv_embedded
bin               MANIFEST.in  setup.py   virtualenv.py
CONTRIBUTING.rst  README.rst   tests      virtualenv_support
username@host:~/virtualenv$ ls -lah virtualenv.py
-rwxrwxr-x. 1 username username 98K Jun 12 13:54 virtualenv.py

Remove it from the current working directory.

username@host:~/virtualenv$ rm virtualenv.py

Verify that the file is removed.

username@host:~/virtualenv$ ls
appveyor.yml  CONTRIBUTING.rst  MANIFEST.in  setup.cfg  tox.ini
AUTHORS.txt   docs              README.rst   setup.py   virtualenv_embedded
bin           LICENSE.txt       scripts      tests      virtualenv_support

Change directory into the most recent weekly snapshot. In this case, it's Weekly_nfshomes_2024-06-23_00:00.

username@host:~/virtualenv$ ls /nfshomes/username/.snapshot
nfshomes_2024-06-25_00:00  nfshomes_2024-06-27_04:00
nfshomes_2024-06-26_00:00  nfshomes_2024-06-27_08:00
nfshomes_2024-06-26_12:00  nfshomes_2024-06-27_12:00
nfshomes_2024-06-26_16:00  Weekly_nfshomes_2024-06-16_00:00
nfshomes_2024-06-26_20:00  Weekly_nfshomes_2024-06-23_00:00
nfshomes_2024-06-27_00:00
username@host:~/virtualenv$ cd /nfshomes/username/.snapshot/Weekly_nfshomes_2024-06-23_00\:00/virtualenv

The file still exists in the snapshot.

username@host:~/.snapshot/Weekly_nfshomes_2024-06-23_00:00/virtualenv$ ls
appveyor.yml      docs         scripts    tox.ini
AUTHORS.txt       LICENSE.txt  setup.cfg  virtualenv_embedded
bin               MANIFEST.in  setup.py   virtualenv.py
CONTRIBUTING.rst  README.rst   tests      virtualenv_support

Copy the file back to the original directory.

username@host:~/.snapshot/Weekly_nfshomes_2024-06-23_00:00/virtualenv$ cp virtualenv.py /nfshomes/username/virtualenv/

Change back to the original directory.

username@host:~/.snapshot/Weekly_nfshomes_2024-06-23_00:00/virtualenv$ cd /nfshomes/username/virtualenv/

Confirm that the file is restored from the snapshot.

username@host:~/virtualenv$ ls
appveyor.yml      docs         scripts    tox.ini
AUTHORS.txt       LICENSE.txt  setup.cfg  virtualenv_embedded
bin               MANIFEST.in  setup.py   virtualenv.py
CONTRIBUTING.rst  README.rst   tests      virtualenv_support