#Backup using rsync
Explore tagged Tumblr posts
xylophonetangerine · 1 year ago
Text
How to run automatic nightly backups of your computer:
Linux: Set up a cronjob to run rsync or borgbackup or install a Flatpak to do it. All of this is gratis and libre, of course.
Macintosh: Use Time Machine which is included with the operating system.
Windows: "Well, Microsoft removed the backup feature from Windows 10 to sell more OneDrive plans so your best option is to use either MeeVee Reflect (doesn't do what you asked for), SoftSponge™ DataSquirt™ (proprietary and $175), or RecRxWxBackCopy (last updated in 2007)."
12 notes · View notes
hawkstack · 4 months ago
Text
Recovering Lost Data in Linux: Best Methods and Tools
Data loss can be a nightmare, especially when working with critical files on a Linux system. Whether due to accidental deletion, file system corruption, or hardware failure, recovering lost data is possible with the right approach. This blog post covers the best methods and tools to help you retrieve lost files efficiently.
Common Causes of Data Loss in Linux
Before diving into recovery methods, it’s essential to understand the common causes of data loss:
Accidental Deletion – Using rm without backups or the -rf flag on critical directories.
File System Corruption – Due to power failures, improper shutdowns, or system crashes.
Hardware Failures – Issues with hard drives, SSDs, or bad sectors.
Partition Table Errors – Accidental formatting or deletion of partitions.
Malware or Software Bugs – Some viruses or faulty updates may delete or corrupt files.
Best Methods to Recover Lost Data
1. Check Trash or Backup
Before using recovery tools, check if your deleted files are in the Trash (~/.local/share/Trash/) or if you have a backup using tools like rsync, Timeshift, or cloud storage.
2. Use extundelete for Ext3/Ext4 Recovery
For ext3/ext4 file systems, extundelete can help recover files from an unmounted partition.
sudo apt install extundelete   # Install extundelete
sudo umount /dev/sdX1          # Unmount the partition
sudo extundelete /dev/sdX1 --restore-all  # Restore all files
3. Recover Deleted Files with TestDisk
TestDisk is a powerful tool to recover lost partitions and files.
sudo apt install testdisk  # Install TestDisk
sudo testdisk              # Run the tool and follow the interactive steps
4. Restore Files with PhotoRec
For recovering specific file types (e.g., images, documents), PhotoRec is useful.
sudo apt install photorec  # Install PhotoRec
sudo photorec              # Run the tool and follow the prompts
5. Recover Data from Disk Images with ddrescue
If the disk has bad sectors, creating an image before recovery is recommended.sudo apt install gddrescue # Install ddrescue ddrescue -r 3 /dev/sdX imagefile logfile # Clone the disk for recovery
6. Use fsck for File System Repair
For file system errors, fsck can help repair corruption.
sudo fsck -y /dev/sdX1 # Check and repair file system errors
Preventing Future Data Loss
Regular Backups – Use rsync, Timeshift, or cloud backups.
Enable Trash Support – Instead of rm, use trash-cli for safer deletions.
Monitor Disk Health – Use smartctl to check drive health:
sudo smartctl -a /dev/sdX
Avoid Writing to Lost File Locations – Minimize disk activity to prevent data overwriting.
Conclusion
Losing data on Linux doesn’t have to be permanent. With tools like TestDisk, PhotoRec, and extundelete, you have a good chance of recovering lost files. However, prevention is always the best strategy—regular backups and careful file management can save you from potential disasters.
Need professional Linux data recovery support? Contact HawkStack Technologies for expert assistance!
For more details visit www.hawkstack.com
0 notes
geekrewindcom · 6 months ago
Text
How to Backup and Restore Files with Rsnapshot on Ubuntu
This article explains how to backup and restore files with Rsnapshot on Ubuntu Linux. rsnapshot is a filesystem snapshot utility for making backups on a local or remote system. It leverages the capabilities of rsync and hard links. Hard links are a feature of the file system that allows multiple files to point to the same data on disk, which is used by rsnapshot to efficiently create incremental…
0 notes
codezup · 7 months ago
Text
Creating a File System Backup Tool with Golang and rsync: A Step-by-Step Guide
1. Introduction In this tutorial, we will learn how to create a file system backup tool using Golang and rsync. This tool will help you automate and manage backups of your important data. By the end of this guide, you will have a working backup solution that you can customize to fit your needs. Prerequisites: – Basic understanding of Go programming language – Familiarity with Linux command-line…
0 notes
maddiem4 · 11 months ago
Text
I agree, but think there's and even truer middle ground: Linux isn't a panacea for preventing infrastructure failures, but it gets you a lot that you don't have on Windows.
First of all, it puts the update schedule in your own hands. You can make a lot of decisions about update pace and timing based on what distro/repositories you use, and when you run commands. It's possible to make bad decisions, but they'll be on you - there's far less surface area for some dumbass vendor to remotely brick all your critical infrastructure. This is largely or completely centralized under your package manager.
Secondly, software installed via your distro usually has the benefit of being maintained by a team of people who are professional maintainers separate from upstream, often with infrastructure for worldwide rolling updates and error reporting. Bad patches are less likely to ever get sent to your machine.
Thirdly, Linux has less need for antivirus software. I'm not saying it's never appropriate, but the situations where it makes sense to install are niche in comparison to Windows. And you avoid a lot of surface error for horrific IT headaches by not having a privileged subsystem constantly running that may incorrectly identify your service processes or resources as malicious. The nature of AV is that it's subject to failure, and those failures are subject to being pretty consequential, and since switching to Linux I've gotten pretty comfortable navigating the world without a bomb collar around my neck.
Basically, you're right about the best practices you listed. Linux, in my experience, has made all of them more convenient/viable for teams of any scale, including backups (which, at their simplest, can be rsync run via cron) and system reimaging. It's not that you can't do that with Windows! But I'm spoiled by the free tools to make it dumbass-easy on Linux.
it's honestly nuts to me that critical infrastructure literally everywhere went down because everyone is dependent on windows and instead of questioning whether we should be letting one single company handle literally the vast majority of global technological infrastructure, we're pointing and laughing at a subcontracted company for pushing a bad update and potentially ruining themselves
like yall linux has been here for decades. it's stable. the bank I used to work for is having zero outage on their critical systems because they had the foresight to migrate away from windows-only infrastructure years ago whereas some other institutions literally cannot process debit card transactions right now.
global windows dependence is a massive risk and this WILL happen again if something isn't done to address it. one company should not be able to brick our global infrastructure.
5K notes · View notes
nel-world · 7 months ago
Text
Assess Application and Cluster Readiness
Review Application Dependencies:
Analyze libraries, JDK versions, frameworks (e.g., Spring Boot, Jakarta EE), and external services (databases, APIs).
Identify any Kubernetes-specific configurations (e.g., ConfigMaps, Secrets, environment variables).
Containerization:
Ensure your Java app is containerized using tools like Docker.
Update the Dockerfile if necessary (e.g., for JDK/JRE updates or changes in base image).
2. Prepare Kubernetes Environment
Target Cluster Validation:
Ensure the target Kubernetes cluster is set up and ready.
Check for compatibility with the current cluster’s API version and resources.
Namespace Setup:
Create equivalent namespaces, RBAC roles, and policies in the target cluster.
Storage:
Verify Persistent Volume Claims (PVCs) and ensure similar storage classes are available.
3. Backup and Export Resources
Kubernetes Resources:
Export all application-related resources using kubectl:bashCopy codekubectl get all -n <namespace> -o yaml > resources.yaml
Persistent Data:
Back up database data or persistent volumes using tools like Velero or rsync.
4. Migrate Application Configurations
ConfigMaps and Secrets:
Export existing configurations:bashCopy codekubectl get configmap -n <namespace> -o yaml > configmap.yaml kubectl get secret -n <namespace> -o yaml > secret.yaml
Reapply them in the new cluster:bashCopy codekubectl apply -f configmap.yaml kubectl apply -f secret.yaml
5. Deploy to Target Cluster
Deploy Application:
Use Helm charts, Kubernetes manifests, or CI/CD pipelines to deploy the Java application to the new cluster.
Update the kubeconfig for the target cluster:bashCopy codekubectl config use-context <target-cluster-context> kubectl apply -f resources.yaml
Persistent Volumes:
Ensure data is restored to the persistent volumes if needed.
6. Test the Migration
Validation:
Ensure the application is running as expected (pods, services, and networking).
Run integration and regression tests.
Connectivity:
Validate external service integrations (e.g., databases, APIs).
Check ingress configurations for public access.
7. Cutover and Cleanup
Switch Traffic:
Update DNS or external load balancer to direct traffic to the new cluster.
Monitor:
Use tools like Prometheus, Grafana, or ELK Stack to monitor application health.
Clean Up Old Environment:
After verifying stability, clean up resources in the old cluster.
Tools to Assist in Migration
Velero: For backup and restore of Kubernetes resources and persistent volumes.
Helm: To manage application deployments and upgrades.
Kubernetes Dashboard: For real-time cluster monitoring.
Kubectl Plugins: To enhance CLI functionality.
If you provide more details about the migration (e.g., specific cloud providers or Kubernetes environments), I can offer more tailored advice!
4o
You said:
Migration of 5000 files per hr fix
ChatGPT said:
ChatGPT
If you're migrating a large number of files (e.g., 5000 files per hour) and encountering performance bottlenecks, you can improve the speed and reliability of your file migration by addressing several key areas. Here's a step-by-step guide to optimize file transfer:
1. Identify and Analyze Bottlenecks
File System Bottlenecks:
Check the source and destination disk I/O performance.
Ensure the files are not locked or being used during migration.
Network Bandwidth:
Measure your available network bandwidth using tools like iperf and ensure it can handle the expected load.
File Metadata Overhead:
Small files can add significant overhead due to metadata operations (e.g., file creation, permissions).
2. Optimize Transfer Mechanisms
Use Parallel Processing:
Transfer multiple files concurrently using multithreaded or parallel tools like:
rsync with --max-size and --parallel options.
GNU Parallel for concurrent file transfers.
bashCopy codefind /source/directory -type f | parallel -j8 rsync -a {} /destination/directory
Use a custom script or a library like Python's concurrent.futures for more control.
Batch File Transfers:
Group files into batches (e.g., tar archives) to reduce the overhead of transferring many small files individually.bashCopy codetar -cvf files.tar /source/files && rsync files.tar /destination Extract the files on the destination:bashCopy codetar -xvf files.tar
3. Ensure Network Optimization
Compression:
Compress files during transfer to reduce data volume:bashCopy codersync -az /source/directory /destination/directory
Increase TCP Window Size:
Tweak TCP settings for large transfers using tools like scp or rsync with buffer options:bashCopy codersync --bwlimit=0 --whole-file /source /destination
Use Faster Protocols:
Use optimized file transfer protocols like Rclone, Aspera, or SFTP for high-speed transfer.
4. Improve Source and Destination Performance
Disk Performance:
Optimize disk reads and writes using SSDs for temporary storage or caches.
Ensure the file system supports efficient file handling (e.g., ext4, XFS).
File System Tuning:
For very large numbers of files, tune parameters like inode_cache to handle metadata efficiently.
5. Error Handling and Retry Logic
Retry Failed Transfers:
Use tools like rsync to retry failed files automatically:bashCopy codersync -avz --partial --progress /source /destination
Logging and Monitoring:
Log all transferred files and
4o
You said:
File trsnsfer to s3 improve
ChatGPT said:
ChatGPT
Improving file transfer to Amazon S3 requires addressing both performance and reliability. Below are strategies and tools to optimize large-scale or high-volume file transfers:
1. Use AWS-Specific Tools
AWS CLI with Parallelism:
Use the --multipart-chunk-size-mb and --parallel flags to upload files in parallel and in chunks:bashCopy codeaws s3 cp /local/path s3://your-bucket-name --recursive --storage-class STANDARD_IA --region <region>
Enable parallel transfers: Update your AWS CLI configuration file (~/.aws/config) to increase concurrency:plaintextCopy code[default] s3 = max_concurrent_requests = 10 max_queue_size = 1000 multipart_threshold = 64MB multipart_chunksize = 64MB
AWS DataSync:
Use AWS DataSync for automated, high-performance, large-scale transfers with minimal manual intervention. DataSync can also manage retry and error handling.
2. Optimize S3 Uploads
Multipart Upload:
Use multipart uploads for files larger than 100 MB to improve transfer speed and reliability.
Example using AWS CLI:bashCopy codeaws s3api create-multipart-upload --bucket your-bucket-name --key file_key
Automate multipart uploads with the AWS SDK or tools like boto3 for Python.
Use the Correct Storage Class:
Choose the appropriate storage class to save costs and improve upload speeds:
STANDARD (default): High performance for frequently accessed data.
INTELLIGENT_TIERING: Automatically optimizes storage costs for infrequently accessed files.
3. Improve Network Performance
Enable Transfer Acceleration:
Use S3 Transfer Acceleration for faster uploads over long distances by leveraging AWS edge locations:bashCopy codeaws s3 cp /local/path s3://your-bucket-name --region <region> --endpoint-url https://<bucket-name>.s3-accelerate.amazonaws.com
Compression:
Compress files before transferring to reduce data size:bashCopy codetar -czvf archive.tar.gz /local/path && aws s3 cp archive.tar.gz s3://your-bucket-name
Optimize Network:
Use AWS Direct Connect or a high-bandwidth internet connection for large-scale transfers.
Monitor latency and bandwidth with tools like iperf.
4. Automate and Parallelize Transfers
Rclone:
Use rclone for high-speed S3-compatible transfers with parallelism and retry capabilities:bashCopy coderclone copy /local/path s3:your-bucket-name --transfers 16 --s3-upload-concurrency 16
GNU Parallel:
Transfer files concurrently by splitting file lists:bashCopy codefind /local/path -type f | parallel -j10 aws s3 cp {} s3://your-bucket-name
5. Error Handling and Retry
Retry Mechanisms:
Use tools or scripts that automatically retry failed uploads.
AWS CLI has built-in retry logic; increase retries if necessary:bashCopy codeaws s3 cp --cli-read-timeout 600 --cli-connect-timeout 600 /local/path s3://your-bucket-name
Chunked Retry:
Break large transfers into smaller, manageable chunks and retry failed chunks only.
6. Monitor and Optimize Transfers
AWS CloudWatch Metrics:
Monitor transfer performance and error rates in real-time.
S3 Inventory:
Use S3 inventory reports to validate uploaded files.
AWS SDKs or Custom Scripts:
Build custom monitoring and retry logic with SDKs like boto3 (Python).
Example Optimized Upload Command
bash
Copy code
aws s3 cp /local/path s3://your-bucket-name --recursive --storage-class STANDARD --region us-east-1 --cli-read-timeout 600 --cli-connect-timeout 600
When to Use Snowball or Snowmobile
For extremely large datasets (terabytes or petabytes), use AWS Snowball or AWS Snowmobile for offline data transfer to S3.
These steps can dramatically improve the efficiency and reliability of your file transfer process to S3. Let me know if you need help implementing any of these!
4o
You said:
Improve fole transfers
ChatGPT said:
ChatGPT
Improving file transfer performance and reliability, whether between servers, local systems, or to cloud storage like Amazon S3, involves a combination of strategies. Here are some best practices for improving file transfers:
1. Optimize the File Transfer Process
Parallelize Transfers
Transfer multiple files concurrently to improve throughput:
Use tools like rsync, scp, or cloud-specific SDKs with multi-threading capabilities.
Example with rsync:bashCopy codersync -azP --info=progress2 --max-size=100M --exclude="*.tmp" /source/ /destination/
Batch Small Files
Small files cause metadata overhead during transfer. Bundle them into archives:bashCopy codetar -czvf archive.tar.gz /source/ Transfer the archive, then extract on the destination:bashCopy codetar -xzvf archive.tar.gz
2. Use High-Performance Transfer Tools
Rclone
Ideal for cloud storage and large-scale transfers with parallelism:bashCopy coderclone copy /source/ remote:bucket-name --transfers=16 --checkers=8
GNU Parallel
Parallelize file uploads/downloads:bashCopy codefind /source/ -type f | parallel -j8 scp {} user@destination:/target/
Multithreaded Tools
Use tools with built-in multithreading, such as bbcp, Aspera, or scp (with parallel scripts).
3. Network Optimization
Compression
Compress files before transfer to reduce the amount of data transmitted:bashCopy codegzip largefile.txt Or combine with the transfer:bashCopy codetar czf - /source/ | ssh user@destination "tar xzf - -C /target/"
Bandwidth Management
Limit bandwidth usage to prevent throttling:
With rsync:bashCopy codersync --bwlimit=1000 -az /source/ /destination/
Use TCP tuning options to optimize network transfer rates:bashCopy codesysctl -w net.ipv4.tcp_window_scaling=1
Use Faster Protocols
Use optimized transfer protocols:
SFTP: Secure but slower for high-volume transfers.
Rsync/SSH: Efficient for incremental and large transfers.
Aspera: High-speed UDP-based protocol.
Enable Transfer Acceleration (Cloud)
For Amazon S3:bashCopy codeaws s3 cp /source/ s3://your-bucket/ --region <region> --endpoint-url https://<bucket-name>.s3-accelerate.amazonaws.com
4. Error Handling and Resilience
Resume Transfers
Use tools that support resuming failed transfers:
Rsync:bashCopy codersync -az --partial /source/ /destination/
AWS CLI:bashCopy codeaws s3 cp --continue /source/ s3://bucket-name/
Retry Logic
Implement retry logic for failed transfers using scripts or tools.
Example using bash:bashCopy codefor i in {1..5}; do scp file user@destination:/target/ && break || sleep 5 done
5. Monitor and Analyze Performance
Real-Time Monitoring
Monitor progress with tools:
Rsync: --progress flag.
SCP: Wrap in pv for progress visualization:bashCopy codetar cf - /source/ | pv | ssh user@destination "tar xf - -C /target/"
Analyze Bottlenecks
Use tools like iperf or nload to check network performance.
Use iotop or dstat to monitor disk I/O on both source and destination.
6. Scale with Advanced Solutions
Distributed File Transfer
Use tools like Globus for efficient distributed data transfers.
Data Transfer Appliances
For extremely large datasets, consider appliances like AWS Snowball or offline methods to ship data physically.
Content Delivery Networks (CDNs)
Use CDNs for faster file distribution to end users.
By combining these strategies—parallelism, compression, protocol optimization, and monitoring—you can significantly enhance file transfer speed and reliability. Let me know if you'd like further customization for a specific use case!
4o
You said:
Threadpool
ChatGPT said:
ChatGPT
A thread pool is a collection of pre-initialized worker threads that stand ready to perform tasks. Instead of creating and destroying threads for each task, a thread pool manages a set of reusable threads, improving performance and resource utilization in multi-threaded applications.
Here’s how to effectively use and optimize thread pools in your application.
Why Use a Thread Pool?
Performance: Reduces the overhead of creating and destroying threads repeatedly.
Resource Management: Controls the number of concurrent threads, preventing system overload.
Scalability: Allows a controlled environment for task execution, making it easier to scale applications.
Key Concepts of Thread Pools
Core Threads: Minimum number of threads that are always kept alive.
**Max Threads
4o
You said:
Improve java spring file transfer
ChatGPT said:
ChatGPT
Improving file transfer in a Java Spring application involves optimizing both the code and the underlying infrastructure. Below are strategies to enhance file transfer performance and reliability.
1. Optimize File Transfer Code
Use Streaming for Large Files
Avoid loading the entire file into memory; instead, use streaming:javaCopy code@PostMapping("/upload") public ResponseEntity<String> uploadFile(@RequestParam("file") MultipartFile file) throws IOException { try (InputStream inputStream = file.getInputStream()) { // Process the input stream directly // Example: Save the file Files.copy(inputStream, Paths.get("target-directory/" + file.getOriginalFilename()), StandardCopyOption.REPLACE_EXISTING); } return ResponseEntity.ok("File uploaded successfully!"); }
Enable Asynchronous File Transfers
Use Spring's @Async annotation for non-blocking file uploads/downloads:javaCopy code@Async public CompletableFuture<String> uploadFileAsync(MultipartFile file) { // File processing logic return CompletableFuture.completedFuture("Upload Complete"); }
Use Chunked Uploads for Large Files
Break large files into smaller chunks for efficient transfer and to handle interruptions gracefully:javaCopy code@PostMapping("/uploadChunk") public ResponseEntity<String> uploadChunk(@RequestParam("chunk") MultipartFile chunk, @RequestParam("fileId") String fileId) { // Append chunk data to the file return ResponseEntity.ok("Chunk uploaded successfully!"); }
2. Optimize for Cloud Storage (e.g., AWS S3, Azure Blob)
Use SDKs for Direct Uploads
Use cloud-specific SDKs (e.g., AWS SDK for S3) to upload files directly to cloud storage instead of saving locally first:javaCopy code@PostMapping("/uploadToS3") public ResponseEntity<String> uploadToS3(@RequestParam("file") MultipartFile file) throws IOException { AmazonS3 s3Client = AmazonS3ClientBuilder.defaultClient(); String bucketName = "your-bucket-name"; s3Client.putObject(bucketName, file.getOriginalFilename(), file.getInputStream(), new ObjectMetadata()); return ResponseEntity.ok("File uploaded to S3!"); }
Enable S3 Transfer Acceleration
Use Transfer Acceleration for faster uploads to Amazon S3:javaCopy codeAmazonS3 s3Client = AmazonS3ClientBuilder.standard() .withAccelerateModeEnabled(true) .build();
3. Optimize File Transfer in REST APIs
Enable Compression
Compress file responses to reduce data size:yamlCopy codespring: servlet: multipart: enabled: true max-file-size: 50MB max-request-size: 50MB gzip: enabled: true min-size: 1024
Use HTTP/2
Switch to HTTP/2 for better concurrency and reduced latency:yamlCopy codeserver: http2: enabled: true
Resume Interrupted Uploads
Use ETag or file metadata to allow resumable file uploads:javaCopy code@PostMapping("/resumeUpload") public ResponseEntity<String> resumeUpload(@RequestParam("file") MultipartFile file, @RequestParam("offset") Long offset) { // Resume logic based on offset return ResponseEntity.ok("Upload resumed!"); }
4. Parallelize File Transfers
Multithreaded File Upload
Use a ThreadPoolExecutor or Spring's TaskExecutor:Copy code
In addition to using @Async, there are other strategies and tools to improve file transfer performance and reliability in a Java Spring application. Here are some approaches:
1. Reactive Programming with Spring WebFlux
For truly non-blocking and asynchronous file transfers, use Spring WebFlux:
Streaming File Upload:javaCopy code@PostMapping(value = "/upload", consumes = MediaType.MULTIPART_FORM_DATA_VALUE) public Mono<Void> uploadFile(Flux<FilePart> filePartFlux) { return filePartFlux.flatMap(filePart -> { Path path = Paths.get("target-directory/" + filePart.filename()); return filePart.transferTo(path); }).then(); }
Streaming File Download:javaCopy code@GetMapping(value = "/download", produces = MediaType.APPLICATION_OCTET_STREAM_VALUE) public Mono<ResponseEntity<Resource>> downloadFile() { Path path = Paths.get("target-directory/large-file.txt"); return Mono.just(ResponseEntity.ok() .header(HttpHeaders.CONTENT_DISPOSITION, "attachment; filename=large-file.txt") .body(new FileSystemResource(path))); }
2. Use CompletableFuture and ExecutorService
Combine CompletableFuture with a custom ExecutorService for better control:javaCopy code@PostMapping("/upload") public CompletableFuture<String> uploadFile(@RequestParam("file") MultipartFile file) { ExecutorService executor = Executors.newFixedThreadPool(4); return CompletableFuture.supplyAsync(() -> { try { // File processing logic Files.copy(file.getInputStream(), Paths.get("target/" + file.getOriginalFilename()), StandardCopyOption.REPLACE_EXISTING); return "File uploaded successfully!"; } catch (IOException e) { throw new RuntimeException("File upload failed!", e); } }, executor); }
3. Apache Kafka for Asynchronous Processing
Use Apache Kafka to decouple file upload from processing:
Producer sends file metadata to Kafka after upload:javaCopy code@PostMapping("/upload") public ResponseEntity<String> uploadFile(@RequestParam("file") MultipartFile file) throws IOException { // Save the file Files.copy(file.getInputStream(), Paths.get("target/" + file.getOriginalFilename())); // Send metadata to Kafka kafkaTemplate.send("file-topic", file.getOriginalFilename()); return ResponseEntity.ok("File uploaded and queued for processing!"); }
Consumer processes files asynchronously:javaCopy code@KafkaListener(topics = "file-topic", groupId = "file-group") public void processFile(String fileName) { // Process the file Path path = Paths.get("target/" + fileName); System.out.println("Processing file: " + path); }
4. Chunked File Transfers
Handle large files by uploading them in chunks:
Frontend sends file chunks with an identifier.
Backend reconstructs the file:javaCopy code@PostMapping("/uploadChunk") public ResponseEntity<String> uploadChunk(@RequestParam("chunk") MultipartFile chunk, @RequestParam("fileId") String fileId, @RequestParam("chunkNumber") int chunkNumber) { Path path = Paths.get("target/" + fileId + "_" + chunkNumber); try { Files.copy(chunk.getInputStream(), path, StandardCopyOption.REPLACE_EXISTING); } catch (IOException e) { return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR).body("Failed to upload chunk"); } return ResponseEntity.ok("Chunk uploaded successfully!"); }
Reassemble chunks when all are uploaded.
5. WebSockets for Real-Time Progress
Use WebSockets to provide real-time feedback on file transfer progress:javaCopy code@Controller public class WebSocketController { @MessageMapping("/uploadStatus") @SendTo("/topic/progress") public String sendProgress(String status) { return status; } }
Send progress updates from the server while uploading:javaCopy codesimpMessagingTemplate.convertAndSend("/topic/progress", "50% completed");
6. Redis or Database Queues
Use a Redis queue or a database to handle file metadata asynchronously.
Enqueue metadata after upload:javaCopy coderedisTemplate.opsForList().leftPush("fileQueue", fileMetadata);
Process the queue in the background:javaCopy codeString metadata = redisTemplate.opsForList().rightPop("fileQueue");
7. Use MultipartConfig for Large Files
Configure multipart file handling for large files in application.properties:propertiesCopy codespring.servlet.multipart.max-file-size=1GB spring.servlet.multipart.max-request-size=2GB
Custom bean for fine-tuning:javaCopy code@Bean public MultipartConfigElement multipartConfigElement() { MultipartConfigFactory factory = new MultipartConfigFactory(); factory.setMaxFileSize("1GB"); factory.setMaxRequestSize("2GB"); return factory.createMultipartConfig(); }
8. Use AWS S3 for Direct Uploads
Use pre-signed URLs to offload upload work to the client:javaCopy code@GetMapping("/generatePresignedUrl") public ResponseEntity<String> generatePresignedUrl(@RequestParam String fileName) { AmazonS3 s3Client = AmazonS3ClientBuilder.defaultClient(); GeneratePresignedUrlRequest generatePresignedUrlRequest = new GeneratePresignedUrlRequest("bucket-name", fileName) .withMethod(HttpMethod.PUT) .withExpiration(new Date(System.currentTimeMillis() + 3600 * 1000)); URL url = s3Client.generatePresignedUrl(generatePresignedUrlRequest); return ResponseEntity.ok(url.toString()); }
The client uploads directly to S3 using the URL.
9. Optimize File Transfer for High Performance
Compression
Compress files before upload to reduce transfer size:javaCopy codebyte[] compressedData = compress(file.getBytes()); Files.write(Paths.get("compressed-file.gz"), compressedData);
Load Balancing
Use a load balancer (e.g., AWS ALB or NGINX) for scalable upload endpoints.
Retry Logic
Implement retries for failed transfers to improve reliability:javaCopy codeint maxRetries = 3; while (retries < maxRetries) { try { // Attempt file upload break; } catch (IOException e) { retries++; if (retries == maxRetries) { throw e; } } }
These strategies can enhance file transfer performance, scalability, and reliability in Java Spring applications. Let me know if you need code examples for specific use cases!
4o
You said:
S3 relaibility
ChatGPT said:
ChatGPT
Ensuring reliability when transferring files to Amazon S3 involves minimizing failures, handling errors effectively, and ensuring data integrity. Below are best practices and techniques to achieve reliable file transfers to S3:
1. Use Multipart Upload for Large Files
Multipart uploads split large files into smaller parts, upload them in parallel, and reassemble them in S3. This improves reliability and speeds up transfers.
Example Using AWS SDK (Java)
java
Copy code
AmazonS3 s3Client = AmazonS3ClientBuilder.defaultClient(); String bucketName = "your-bucket-name"; String fileName = "large-file.zip"; String keyName = "uploads/" + fileName; File file = new File(fileName); TransferManager tm = TransferManagerBuilder.standard().withS3Client(s3Client).build(); Upload upload = tm.upload(bucketName, keyName, file); try { upload.waitForCompletion(); System.out.println("File uploaded successfully!"); } catch (AmazonClientException e) { System.err.println("Upload failed: " + e.getMessage()); }
2. Use Retry Logic
Add retry mechanisms to handle intermittent network issues or service interruptions.
AWS SDK Retry Settings
The AWS SDK retries failed requests automatically, but you can customize it:
java
Copy code
ClientConfiguration config = new ClientConfiguration(); config.setRetryPolicy(PredefinedRetryPolicies.getDefaultRetryPolicyWithCustomMaxRetries(5)); AmazonS3 s3Client = AmazonS3ClientBuilder.standard() .withClientConfiguration(config) .build();
3. Enable Transfer Acceleration
Transfer Acceleration uses AWS edge locations to improve upload speeds over long distances.
Enable Transfer Acceleration in S3
Enable it in the S3 bucket settings.
Update your client code to use the accelerated endpoint:
java
Copy code
AmazonS3 s3Client = AmazonS3ClientBuilder.standard() .withAccelerateModeEnabled(true) .build();
4. Validate Data Integrity
Use MD5 checksums to ensure the uploaded file matches the original file.
AWS CLI Example
bash
Copy code
aws s3 cp file.txt s3://your-bucket/ --content-md5 <calculated-md5>
Java Example
java
Copy code
String md5 = Base64.getEncoder().encodeToString(DigestUtils.md5(new FileInputStream(file))); ObjectMetadata metadata = new ObjectMetadata(); metadata.setContentMD5(md5); PutObjectRequest request = new PutObjectRequest(bucketName, keyName, new FileInputStream(file), metadata); s3Client.putObject(request);
5. Monitor File Transfers
Use CloudWatch Metrics to monitor S3 request success, failures, and latencies.
Monitor transfer progress with TransferManager in the AWS SDK:
java
Copy code
TransferManager tm = TransferManagerBuilder.standard().withS3Client(s3Client).build(); Upload upload = tm.upload(bucketName, keyName, file); upload.addProgressListener(progressEvent -> { System.out.println("Transferred bytes: " + progressEvent.getBytesTransferred()); }); upload.waitForCompletion();
6. Handle Failures Gracefully
Use Resumable Transfers for interrupted uploads with TransferManager:
java
Copy code
TransferManager tm = TransferManagerBuilder.standard().build(); Upload upload = tm.upload(bucketName, keyName, file); // Add a progress listener upload.addProgressListener((ProgressListener) progressEvent -> { System.out.println("Transferred: " + progressEvent.getBytesTransferred()); }); // Graceful failure handling try { upload.waitForCompletion(); } catch (AmazonClientException e) { System.err.println("Error occurred: " + e.getMessage()); }
7. Use Pre-Signed URLs
Generate pre-signed URLs for reliable, time-limited uploads directly from the client, reducing the load on your server.
Generate Pre-Signed URL
java
Copy code
GeneratePresignedUrlRequest generatePresignedUrlRequest = new GeneratePresignedUrlRequest(bucketName, keyName) .withMethod(HttpMethod.PUT) .withExpiration(new Date(System.currentTimeMillis() + 3600 * 1000)); URL url = s3Client.generatePresignedUrl(generatePresignedUrlRequest); System.out.println("Pre-Signed URL: " + url);
8. Use S3 Event Notifications
Configure S3 Event Notifications to trigger AWS Lambda or SNS for post-upload validation, processing, or alerting on failures.
Example: Notification for Upload Completion
Configure your S3 bucket to send an event to an SQS queue or Lambda function upon successful upload.
9. Leverage Data Replication
Use S3 Cross-Region Replication (CRR) or Same-Region Replication (SRR) for redundancy.
Automatically replicate files to another bucket for disaster recovery.
10. Automate with AWS DataSync
Use AWS DataSync for automated and highly reliable file transfers between on-premises storage and S3. It includes built-in retry and integrity checks.
11. Optimize Network Performance
Compress files before uploading:javaCopy codeFiles.write(Paths.get("compressed-file.gz"), gzipCompress(fileContent));
Use efficient transfer protocols (e.g., HTTP/2 if supported by your client).
12. Secure Transfers
Always use HTTPS for secure communication.
Use S3 Bucket Policies and IAM Roles to restrict access to authorized users.
Example: Complete Reliable Upload Function
java
Copy code
public void reliableUpload(File file, String bucketName, String keyName) { AmazonS3 s3Client = AmazonS3ClientBuilder.defaultClient(); TransferManager tm = TransferManagerBuilder.standard().withS3Client(s3Client).build(); try { // Multipart upload Upload upload = tm.upload(bucketName, keyName, file); upload.addProgressListener((ProgressListener) progressEvent -> { System.out.println("Transferred bytes: " + progressEvent.getBytesTransferred()); }); upload.waitForCompletion(); System.out.println("File uploaded successfully!"); } catch (AmazonClientException e) { System.err.println("Upload failed: " + e.getMessage()); } finally { tm.shutdownNow(); } }
0 notes
servermo · 7 months ago
Text
Build and Secure Your Linux Server: A Quick Guide
Want to create a powerful and secure Linux server? Here's your step-by-step guide to get started!
Why Linux? Linux is the go-to for flexibility, security, and stability. Whether you’re hosting websites or managing data, it's the perfect choice for tech enthusiasts.
1. Choose Your Distribution Pick the right distro based on your needs:
Ubuntu for beginners.
CentOS for stable enterprise use.
Debian for secure, critical systems.
2. Install the OS Keep it lean by installing only what you need. Whether on a physical machine or virtual, the installation is simple.
3. Secure SSH Access Lock down SSH by:
Disabling root login.
Using SSH keys instead of passwords.
Changing the default port for added security.
4. Set Up the Firewall Configure UFW or iptables to control traffic. Block unnecessary ports and only allow trusted sources.
5. Regular Updates Always keep your system updated. Run updates often to patch vulnerabilities and keep your server running smoothly.
6. Backup Your Data Use tools like rsync to back up regularly. Don’t wait for disaster to strike.
7. Monitor and Maintain Regular check logs and monitor server health to catch any issues early. Stay ahead with security patches.
0 notes
onsomekindofstartrek · 11 months ago
Text
There’s an article going around about a professional romance author who was locked out of her google drive for an unspecified violation and lost 22,000 words of work that way.
And like, yes, that’s kafkaesque and yes, Google is acting abominably. The spokesperson that is quoted in the article should lose her job if she really took the attitude that the author is claiming she did. And there should be legal protections and liability insurance for this kind of thing happening to professionals who depend on online services for their livelihoods.
But at the same time this is a professional person who is inarguably showing poor backup discipline with work files, and while I wouldn’t say it to her face, I don’t think it should be controversial to say that this should be a cautionary tale.
If you have something you don’t want to lose, even just for personal reasons, and especially over the long term, there is a minimum backup discipline you should follow. And I would argue that if it’s worth anything at all, that minimum is “3-2-1.”
3: three separate backup copies of your data BESIDES the operational one.
2: two different kinds of media: yes, this could be cloud and flash sticks, or it could be flash sticks and burning to DVD (yes, I know that’s old fashioned but no, I really mean it.) This way if you accidentally erase a flash drive, you have a DVD that you’re not going to erase. If you lose access to a DVD drive you have a flash stick. If you use hard drives, you should also use flash media, in case something happens that physically ruins your hard drives like falling, heat or magnetic pulse. It could happen.
And finally, 1: you should have one backup offsite. If your house burns down and you just had three on-site backups, they could still all be ruined. And to be honest cloud storage is a slam dunk for this. It’s multiple copies and likely a different type of medium (being stored in multiple copies on hard drives) and it’s offsite. But if you ONLY use the cloud and get locked out because of corporate bullshit, then you’re just as fucked.
My recommendation for non-techie people? Have two hi-capacity flash sticks or maybe a flash stick and an external hard drive. Keep one flash stick on your keys so that if your house burns down while you are away, you have a backup with you. And then also back up to the cloud. Do all three at the same time, as often as you make a change to your files that would be impossible, time-consuming or emotionally challenging to do again.
For technologically savvy people, I swear by having an on-site raid SSH/rsync server with mirroring (which satisfies two or more of the three copies) and also using the cloud. That satisfies the whole thing with added benefits, as far as I’m concerned; it’s a lot more convenient than using multiple physical media that you have to connect to your computer every time you back up, and rsync is a very efficient way to back up files, since it only transmits what’s been changed, not the entirety of files that already exist in the backup.
Don’t for the love of god become the next victim of google’s digital plutocracy, and don’t for the love of god lose your only pictures of your loved ones or your life’s work in a house fire.
1 note · View note
dollar2host · 1 year ago
Text
Website Migration Checklist: No Data Loss Assured
Changing to a new content management system (CMS) or switching to web hosting services are both examples of website migration processes. Every website hosting company offers either free website migration or paid solutions, in which website owners are required to migrate their websites from their existing servers to new servers as part of the migration process.
Tumblr media
A significant number of website proprietors are concerned about the loss of data, and managed assistance is essential for mitigating hazards. In the case of a website that is constructed using WordPress, for instance, it is advisable to go with the managed WordPress hosting option. In this scenario, the process of migration will be handled by professionals with technical expertise. It is also important to note that there will be no loss of data since they adhere to the website migration checklist, which I will demonstrate in the following paragraphs.
Continue reading the article to obtain the ideal checklist for website migration, which will ensure that no data is lost and will optimize search engine optimization.
Website Migration: What Does It Mean?
Moving a website involves a lot more than just transferring web hosting service providers; it also involves a lot of other things. Additional procedures, such as upgrading website technology, URL structure, design, or location, are included in this process in order to achieve improved internet visibility.
Considering that your hard-earned SEO efforts are involved in the process, you could be under the impression that it is a difficult procedure. When a website owner uses the incorrect migration technique, they run the risk of experiencing a variety of problems, including the following:
1. Error code 404
2. a website that is lacking material
3. There is no rating
Always ensure that you have a backup of the data before beginning the process of migrating your website. It is also recommended that you make use of tools that can examine the page inventory. There are a variety of SEO site crawler tools that can provide you with a live list of all pages. After the migration is complete, compare the number of pages that were moved to the list that was provided.
Website Migration Checklist: Important Considerations to Take Into Account
Presented below is the beginner's guide that will make the process of migrating their website easier.
Aim or purpose
In the first place, be sure that you are crystal clear on the goal that you want to accomplish with a new website. Are you interested in a new website structure, domain name, DNS, or a new design for your website? Following the conclusion of your decision, you can either manually move your website or request that your website hosting service provider do it for you. Not only do dependable businesses not charge for it, but they also implement cutting-edge technology such as FileZilla (File Transfer Protocol), the Rsync command, and SSH access.
During the free movement, there is no requirement for any kind of financial investment. On the other hand, web hosts that provide premium migration services will charge you a small amount in order to finish the procedure. Upon completion of the migration, the outcome that you had envisioned must be achieved.
Create a duplicate of your website.
Creating a backup of your website or putting it into an external storage device is a crucial step. Considering that your website will be transferred to the new server, you should make use of the backup machine to generate a copy of your internet site.
Stay in touch with your clients and guests.
It is essential that you provide this letter to your customers and visitors in order to notify them about the migration process. Customers who visit the website will not experience any inconvenience as a result of the notification. They are going to receive a notification, and they are not going to engage in any surfing activity during that time!
Be sure to include this procedure in your website migration checklist at all times. In the event that it is necessary, you can include such notes in your email, on your landing page, or through WhatsApp chats.
It is possible that many owners of eCommerce websites will choose this strategy in order to keep their customers updated.
With the assistance of the backup team, developers and IT experts should be prepared with their resources and tools to deal with any unforeseen circumstances. Immediately following the migration, there may be certain activities that call for rapid attention in order to mitigate the risk of data loss. Taking this step reduces potential dangers and guarantees that website operations are stress-free.
Experts in key areas, such as search engine optimization executives, content writers, marketing automation tools, user experience specialists, and others, should be included on your team. In general, this approach will make it possible for everyone to bring to light any potential difficulties prior to the relocation of the website. Alterations made at the eleventh hour are an indication of a lack of professionalism.
Established a deadline for migration
How long it takes to migrate a website is directly proportional to the size of the website that is being moved. To reach your goal and introduce new pages in a timely manner, however, you will need to adhere to a set timetable. An extended deadline for website transfer is not something that can be afforded by enterprises that manage websites that generate billions of dollars in revenue.
According to the findings, it results in a very low volume of traffic and restricts the number of clients. In light of this, establishing a migration date is not only economically feasible but also beneficial for the entire IT unit. In addition, significant alterations to websites will render them unavailable to visitors, which will result in a decrease in the volume of traffic. Migrating on a predetermined timetable during off-hours is therefore suggested.
Evaluate Your Analytical Performance
Never, ever disregard the analytics data that your website generates. In the aftermath of the relocation, it will be beneficial to determine whether or not there is any loss of traffic. If you want to gather exact statistics on where the website traffic is lost, the easiest way to do it is to compare two things side by side.
You can examine the traffic count of particular landing pages by selecting the "Traffic Acquisition" option from the "Reports" section of Google Analytics. If you are referring to Google Analytics, you can perform this check. It is essential to put this strategy into action because each of the landing pages contributes something of value to the authority of your page. Therefore, any loss of data will result in a lower ranking for the website on search engines, which will lead to bad performance.
A Website Migration Checklist for Search Engine Optimization
Howdy, search engine optimization fans! This is the checklist that your team needs to complete in order to successfully migrate the website.
Gather all of the URLs.
In order to assemble all of the website URLs that are indexed or not indexed, the SEO team must do so. It is necessary for them to determine all of the pages that will be mapped during the ongoing process of website consolidation. The importance of this phase cannot be overstated when it comes to the maintenance of traffic levels following migration, particularly in the event that URL structures are altered or URLs are merged. Depending on the size of the website, it is possible to map all URLs to one another, or it is possible to map only priority URLs to one another.
Map Redirects That Are Required
Once it has been determined which URLs require mapping, a draft should be created that includes the list of URLs that have been mapped as well as the new path for each URL. Here is a suggestion for columns that you may include in the Excel sheet that you have created.
New Destination URL
Legacy URL
Pre-Migration Status
Code Old Destination URL
If it is not possible to map all URLs to one another within the scope of your migration project, then you should make sure that at least all priority pages have 1:1 mappings to equivalent or near-similar sites. This would be the ideal case.
Create new analytics for use.
Following the migration of the website, the changes to the Data Setting in Google Analytics will be new. In addition to deploying GTM code in the backend of the website, the SEO team is responsible for updating all landing page paths. It goes without saying that the development team will be required to lend a hand, but the SEO team will be the only one to provide significant tracking-related recommendations.
Begin using paid advertising.
What are some ways that you may let your clients and visitors know about the revised URLs? Using paid campaigns is the solution to this problem. In order to accomplish this, you will want Google Ad banners, content for Display Ads, and social media posts in order to run paid campaigns and get paid visitors. It is necessary to allocate a budget at the beginning, but once the page authority has been established, organic traffic will progressively increase. 
When Should You Begin the Process of Migrating Your Website?
Here are some suggestions that I would like to share with you on the appropriate timing of the migration of your website.
Changes to the Site's Top-Level
In the event that you need to make significant modifications to your website, you will need to migrate it. The migration of content to a new domain, the change of server locations, and the migration to website hosting providers are all examples of these types of situations. A top-level modification can be anything as simple as transferring subdirectories (for example, "example.com/category") to subdomains (for example, "example.site.com"), which is a relatively minimal change. The reason for this is that you are altering the URL path in the database of the website.
Making your webpages compatible with the Accelerated Mobile Pages (AMP) framework is yet another significant improvement that you should make. In order to better meet the requirements of mobile users, search engines such as Google, Bing, and Yahoo give preference to websites that are mobile-friendly. In such circumstances, it is necessary to move the entirety of the website.
Redirect to the 301
In the event that you are going to make significant changes to the fundamental structure of your website, you will need to migrate your website. One of the primary goals of this endeavor is to communicate with people all across the world. In order to accomplish this, website proprietors translate the information that is already present and establish a respective subdirectory for each country.
In addition, a 301 redirect is required in order to change permalinks that contain post IDs to descriptive slug information. In situations like this, it will be necessary to use 301 redirects in order to permanently alter the URLs so that they point to the new URLs. If you do not implement these redirects before the new site structure goes live, you run the danger of losing your search engine optimization score since search engines will regard these sites to be problematic.
Redesign of the Website
Even modifications that do not affect the overall structure of your website or its URL are considered to be part of the definition of website migration by some. Rebranding your website or making changes to its design are also included in this category.
As a result of the change, it is possible that essential on-page SEO elements will be inadvertently or accidentally lost. You might mistakenly remove heading tags if you change typefaces, or you might forget to add alt tags if you replace on-page images in bulk. Both of these potential outcomes are possible.
Even if they improve a website's usability, user experience upgrades can occasionally reduce the site's search engine optimization (SEO). It is conceivable to write code for a new interactive feature that appears to be user-friendly in such a way that would prevent Google from accessing its content. Whenever a change poses a risk of losing search engine optimization (SEO) throughout the entirety of a website, a migration problem develops.
Conclusion:
Last but not least, we would like to draw the conclusion that the checklist for the migration of the website has a great deal more components, depending on the requirements. A variety of factors, including traffic, website structures, search engine optimization strategies, and technical aspects, are unique to each website. Also, the kind of web hosting service that you select will determine whether or not the migration of your website is a hassle-free process. We have a guide titled "Easily Migrate Your Website to Dollar2host by Yourself" in our Frequently Asked Questions section that you may refer to if you are interested in migrating to Dollar2host servers.
In general, the process of migrating a website calls for a suitable plan, objectives, and resources in terms of both information technology and human resources. Therefore, if you are concentrating on websites and online businesses, you should hire professionals to move the website and speed up its performance.
Tumblr media
Mary Thomas
Dollar2host
Dollar2host.com
We provide expert Webhosting services for your desired needs
Facebook Twitter Instagram
0 notes
ananovareviews · 2 years ago
Text
Backup Hosting Services
Backup Management The backup operation is an integral part of the administration. Most Linux administrators use Linux dumb/restore tools like rsync for making individual copies. Flat Backup: It simplifies the data storage environment by taking snapshots, which are then copied to another location as backup replicas. The data backup is in the same format as the original, making recovery…
View On WordPress
0 notes
t-3-planet · 2 years ago
Text
TYPO3 Backup Plus Extension
Tumblr media
The TYPO3 Backup Plus Extension is a cutting-edge solution that sets a new standard in TYPO3 backup and data security. It serves as a comprehensive all-in-one backup tool, simplifying the process of safeguarding your TYPO3 website's code, assets, and database with just a few clicks.
What sets the TYPO3 Backup Plus Extension apart is its user-friendly nature. It is remarkably easy to install and configure, making it accessible to users of all levels of technical expertise. With a single click, you can initiate manual TYPO3 backups, providing peace of mind in case of unexpected data loss.
With this extension, your TYPO3 website can enjoy enhanced data security, streamlined backup procedures, and compatibility with the latest technologies, all in one versatile package.
Key Features of TYPO3 Backup Plus Extensions
Server & Cloud Backup
Enhance your data backup experience with our solution, which offers seamless compatibility with a wide array of trusted Cloud and Server platforms. Whether you rely on Google Cloud, Amazon S3, Dropbox, SFTP, Rsync, or other preferred services, our system integrates effortlessly, catering to your specific data storage requirements.
One Click Manual Backup
Effortlessly safeguard your data with our user-friendly one-click manual backup feature. Installing and configuring our system is a breeze and takes just a few clicks, making it accessible to users of all technical backgrounds,
Extension offers custom backup solutions tailored to your specific needs. With our smart scheduler feature, you can schedule an unlimited number of custom backups with just one click. These backups can be directed to your preferred destinations, providing you with a flexible and comprehensive backup strategy that aligns with your data management goals. 
Download Logs & History
With this feature, accessing your previously taken backups, reviewing logs, and tracking backup history has never been simpler. This user-friendly interface ensures that you can effortlessly retrieve your backups and keep an eye on the detailed logs and comprehensive backup history.
Easy Schedule Backup
With this feature, you can ensure that your data is consistently and securely backed up according to your preferred schedule, giving you peace of mind and data protection that fits seamlessly into your workflow.
Conclusion
In conclusion, our backup solution offers a comprehensive set of features to simplify and enhance your data protection efforts. With one-click manual backups, custom backup scheduling, and a dedicated dashboard for logs and history, we provide the tools you need to keep your data safe and accessible.  With the ability to schedule unlimited backups using our smart scheduler, you have the flexibility to automate your data protection on your terms.
0 notes
prpl-iris · 4 months ago
Text
I have a 20tb I use for rsync backups :3
you know what i wish i had
large amounts of storage
like two-thirds of my only working drive is full already, nobody told me 500GB wouldn't be enough T^T
263 notes · View notes
hostpoco · 3 years ago
Link
0 notes
nixcraft · 2 years ago
Text
4 notes · View notes
reasonableapproximation · 4 years ago
Text
Continuing the backup saga:
I made some progress on getting duplicity working again by installing a b2sdk ebuild someone posted to the bug tracker. Then I think I started getting a different error still related to importing b2sdk, which I have no idea what was going on. I added some debug printfs to the relevant duplicity module, and it looks like it could import some parts of b2sdk but not others, even though I could import all those parts just fine using the same sys.path in a repl? Weird. But upgrading duplicity to the unstable version in the portage tree fixed it. So I managed to do an online backup again. It took about 12 hours.
Incidentally the command I use is
duplicity incremental /home/phil b2://key:secret@bucketname/home
since I still haven't put it in a file, there's a decent chance I'll be looking for it here some time in future.
(At some point in the past I did a sanity check by writing the date to a .backup-canary file before the backup, then extracting that file from the backup and checking it was correct. I no longer have the command to extract files in my history. I should look into doing this again at some point.)
Meanwhile I ordered a Western Digital portable HD based on this backblaze article suggesting the specific WD hard drives they use are more reliable than the Seagate ones they use. I now realize that should be past tense, the article is from 2014, I should probably have been tipped off by that the largest hard drives it mentions are only 4TB. Oh well.
I could read from the old backup drive fine, so I copied most of the data from it to the new one, starting after work one evening and continuing for fifteen hours until I started work the next morning. At that point I unplugged the keyboard from my USB hub, so I could plug it into my work laptop without unplugging the external hard drive that was also in the hub. For some reason that caused the external to crash, like 75%? of the way through. Sigh.
So after work I resumed the `cp --archive` with `rsync -aHv --append-verify`, and that went for about another five hours. After that finished I wanted to verify that it worked, so I did `find backupdir -fprintf outfile.txt '%u:%g %#m %n %TY-%Tm-%TdT%TH:%TM:%.2TS %y %s\t%P\n'` for both of them. Comparing those files (~3gb each) I could check that all files had the same owner, group, type, size, permissions, mtime and number of hard links. Except directory sizes were different, I guess because of ext3 versus ext4 (but maybe deleted entries could make a difference too?), I used `sed 's/ d [0-9]\+/ d 0/'` to ignore those.
Then finally I did a backup of my laptop hard drive to the new one, that took like twelve hours but it seems to have worked.
2 notes · View notes
codezup · 7 months ago
Text
Boost Data Transfer Speed with AWS Transfer Acceleration and Rsync
Efficient Data Transfer with AWS Transfer Acceleration and Rsync Introduction Efficient data transfer is crucial for businesses that rely on large-scale data transfer operations, such as cloud storage providers, online backup services, and big data analytics companies. In this tutorial, we will explore how to optimize data transfer using AWS Transfer Acceleration and Rsync. Transfer…
0 notes